/* This arexx script calculates a total field from all related track records */ GETDBFORMFIELD ADDRESS twist PARSE ARG dbfilename,rela_x,rela_y,shiftkeys OPEN dbfilename options results GETDBFORMMODE if results != "EDIT" then EXIT tottime = 0 GETDBFORMFIELD "tracks.duration" timestr = result if timestr ~= "" then tottime = tottime + substr(timestr, 1, 2)*60 + substr(timestr,4,2) GETDBFORMFIELD "tracks_2.duration" timestr = result if timestr ~= "" then tottime = tottime + substr(timestr, 1, 2)*60 + substr(timestr,4,2) GETDBFORMFIELD "tracks_3.duration" timestr = result if timestr ~= "" then tottime = tottime + substr(timestr, 1, 2)*60 + substr(timestr,4,2) GETDBFORMFIELD "tracks_4.duration" timestr = result if timestr ~= "" then tottime = tottime + substr(timestr, 1, 2)*60 + substr(timestr,4,2) GETDBFORMFIELD "tracks_5.duration" timestr = result if timestr ~= "" then tottime = tottime + substr(timestr, 1, 2)*60 + substr(timestr,4,2) GETDBFORMFIELD "tracks_6.duration" timestr = result if timestr ~= "" then tottime = tottime + substr(timestr, 1, 2)*60 + substr(timestr,4,2) GETDBFORMFIELD "tracks_7.duration" timestr = result if timestr ~= "" then tottime = tottime + substr(timestr, 1, 2)*60 + substr(timestr,4,2) GETDBFORMFIELD "tracks_8.duration" timestr = result if timestr ~= "" then tottime = tottime + substr(timestr, 1, 2)*60 + substr(timestr,4,2) GETDBFORMFIELD "tracks_9.duration" timestr = result if timestr ~= "" then tottime = tottime + substr(timestr, 1, 2)*60 + substr(timestr,4,2) GETDBFORMFIELD "tracks_10.duration" timestr = result if timestr ~= "" then tottime = tottime + substr(timestr, 1, 2)*60 + substr(timestr,4,2) GETDBFORMFIELD "tracks_11.duration" timestr = result if timestr ~= "" then tottime = tottime + substr(timestr, 1, 2)*60 + substr(timestr,4,2) GETDBFORMFIELD "tracks_12.duration" timestr = result if timestr ~= "" then tottime = tottime + substr(timestr, 1, 2)*60 + substr(timestr,4,2) minutes = tottime%60; secs = tottime // 60 if minutes >= 10 then timestr = minutes else timestr = "0" || minutes if secs >= 10 then timestr = timestr || ":" || secs else timestr = timestr || ":0" || secs SETDBFORMFIELD "total_time" timestr