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.
Error in my Script
You used a backslash instead of the divider symbol (/) on your code.
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.
Code: Select all
begin
if [Length] > 60 then
Hours := [Length] / 60;
Minutes := [Length] mod 60;
end;