Special renumber

If you need help on how to use the program
Post Reply
abcInHell
Posts: 6
Joined: 2008-07-22 22:21:53

Special renumber

Post 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
antp
Site Admin
Posts: 9636
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post 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.
abcInHell
Posts: 6
Joined: 2008-07-22 22:21:53

Post 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
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Post 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".

;)
antp
Site Admin
Posts: 9636
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

I wrote that quickly without testing, I missed some things indeed :D
abcInHell
Posts: 6
Joined: 2008-07-22 22:21:53

Post by abcInHell »

Thank you very much!!! It just worked like a charm :)

Thank you!

Regards,
Post Reply