ReNamer:Scripts:Index filenames

From den4b Wiki
Revision as of 20:08, 8 September 2010 by Den4b (talk | contribs) (Created page with '{{Up|ReNamer:Scripts}} Demonstrates how to insert an incrementing number into the filename. == Code 1 == Author: Denis Kozlov. Date: 13 February 2007. Replaces the whole file…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Demonstrates how to insert an incrementing number into the filename.

Code 1

Author: Denis Kozlov. Date: 13 February 2007.

Replaces the whole filename with the incrementing number.

var
  I: Integer;

begin
  I := I + 1;
  FileName := IntToStr(I);
end.

Code 2

Author: Denis Kozlov. Date: 8 September 2010.

Append an incrementing number surrounded with brackets to the end of the base name.

var
  I: Integer;

begin
  I := I + 1;
  FileName := WideExtractBaseName(FileName) + ' (' +
    IntToStr(I) + ')' + WideExtractFileExt(FileName);
end.