Error in my Script

If you need help on how to use the program
Post Reply
billjets
Posts: 1
Joined: 2009-04-09 13:12:17

Error in my Script

Post by billjets »

In the Report Writer, I am trying to convert the movie Length to hours:minutes. Using the following script, I get a
"List index out of bounds" message.

begin
[Minutes] = [Length]
if [Length] > 60 then
[Hours] = [Length] \ 60
[Minutes] = [Length] Mod 60
end;

I appreciate any help I can get with this.
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Post by bad4u »

You used a backslash instead of the divider symbol (/) on your code.

Code: Select all

begin
if [Length] > 60 then 
  Hours := [Length] / 60;
Minutes := [Length] mod 60;
end;
For discarding the remainder and giving the whole number result, you would need to use the div keyword for hours instead, but it seems the scripting engine doesn't support this one. Maybe you find a workaround for this anyway.
Post Reply