Page 1 of 1

Roman Counter in the Multiple Rename Tool

Posted: 2008-06-12, 08:17 UTC
by kgh
hi.

I use the multiple rename tool very often and would love to see an option-checkbox for a roman counter that does count and insert like:
I
II
III
IV
V
...

here is an example delphi sourcecode:

Code: Select all

function DecToRoman(Decimal: Longint): String;
const
  Romans: Array[1..16] of String = ('I', 'IV', 'V', 'IX', 'X', 'XL',
                                    'L', 'XC', 'C', 'CD', 'D', 'CM',
                                    'M', '(M)', '[M]', '{M}');
  Arabics: Array[1..16] of Integer = (1, 4, 5, 9, 10, 40, 50, 90, 100,
                                      400, 500, 900, 1000, 10000, 100000, 1000000);
var
   iFor: Integer;
begin
  Result := '';
  for iFor := 16 downto 1 do
  begin
    while(Decimal >= Arabics[iFor]) do
    begin
      Decimal := Decimal - Arabics[iFor];
      Result := Result + Romans[iFor];
    end;
  end;
end;
i can't post the web adress cause this is my first post but it is from

delphipraxis[dot]net[slash]post51339[dot]html

greetz from berlin
Konrad H.

Posted: 2008-06-12, 15:29 UTC
by ghisler(Author)
Well, you can't create a content plugin for a counter. But you could write a content plugin which would convert a normal numeric value to Roman numbers. It could look e.g. for the first or last block of numbers in a file name, and then convert them to Roman. Example:
Year1976.txt -> YearMCMLXXVI.txt

Posted: 2008-06-13, 09:58 UTC
by kgh
hmm sure i can also write a small standalone tool in delphi for this but i wanted it to be integrated in the multiple rename tool for not doing an extra step...

aber das scheint der herr ghisler wohl nicht zu wollen?! :-)

greetings
Konrad H.

Posted: 2008-06-13, 17:53 UTC
by sqa_wizard
ntegrated in the multiple rename tool for not doing an extra step...
Well special handling for individuals are covered by plugins best.

This is the main reason for the plugin existence :
Don't bother the majority with problems of individuals, but support individuals in solving even curious tasks.

Posted: 2008-06-14, 08:46 UTC
by kgh
sqa_wizard wrote: Well special handling for individuals are covered by plugins best.

This is the main reason for the plugin existence :
Don't bother the majority with problems of individuals, but support individuals in solving even curious tasks.
hmm i agree.
only thought that this could be nice for everyone.

Posted: 2008-06-14, 23:14 UTC
by Sam_Zen
Hmm. Don't count me in, because I prefer to use as less digits as possible. But I won't ask for hexadecimal.