Page 1 of 1

Special renumber

Posted: 2008-08-01 02:33:17
by abcInHell
Hi out there,

I have a little problem: I use AMC quite long right now, and the "movie numbers" weren't really important for me until now.
But now I want to put my Disks in DVD-boxes and need a special renumbering for my current catalogue. Because if I had added some TV series (i.e. 7 disks), AMC just took the next possible number.

For excample:

Right now it looks like this way:

Code: Select all

#50 | Some movie | Disks: 1
#51 | TV-series | Disks: 7
#52 | some movie | Disks: 1
I want to change it like this way:

Code: Select all

#50 | Some movie | Disks: 1
#51 | TV-series | Disks: 7
#58 | some movie | Disks: 1
What it should do:
1. Begin with movie number #1
2. Set integer (last_movienumber + Disks_of_last_movienumber)
3. Find next movie (1. +1)
4. Set new Number

Could someone please help me to do a script for it? I tried it already by myself, but I am not skilled enough to do it alone yet.

Thank you very much in advance!!

mfg

Posted: 2008-08-01 09:01:14
by antp
Hi,
Something like that may work:

Code: Select all

program Renumber;
var
  Num, Discs: Integer;
begin
  if Num = 0 then
    Num := 1;
  SetField(fieldNumber, Num);
  Discs := StrToInt(GetField(fieldDiscs), 1);
  Num := Num + Discs;
end.
variables are not reset between movies, so "Num" will keep the last used number.

Posted: 2008-08-02 15:54:49
by abcInHell
Thank you antp for your quick help! :)

Unfortunately it does not work, I get always this error:

Code: Select all

ERROR
Script Error in "RENUMBER": type mismatch at line 7 
Line 7 is this one: SetField(fieldNumber, Num);

Do you have any idea how to fix this error?

Kind regards

Posted: 2008-08-02 16:30:20
by bad4u
Num is an integer, while fieldNumber needs a string. You have to transform the Num variable into a string. Change line 7 to:

Code: Select all

SetField(fieldNumber, IntToStr(Num));
Besides you have to use "fieldDisks" instead of "fieldDiscs".

;)

Posted: 2008-08-02 18:05:41
by antp
I wrote that quickly without testing, I missed some things indeed :D

Posted: 2008-08-03 02:00:30
by abcInHell
Thank you very much!!! It just worked like a charm :)

Thank you!

Regards,