Page 1 of 1

Error in my Script

Posted: 2009-05-14 23:11:44
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.

Posted: 2009-05-15 06:21:48
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.