Code: Select all
repeat with n = 1 to the number of lines in gOrders
put item 6 of line n of gOrders into tdate1 -- calculates lateness. Need to do this first so that only those that are late are displayed
put the system date into tdate2
convert tdate1 from system date to seconds
convert tdate2 from system date to seconds
put tdate1 - tdate2 into tdifference
divide tdifference by 60 * 60 * 24
if tdifference >= 0 then exit repeat