Hi Glenn,
Apart from the fact that Rev doesn't do time arithmetic like that, you should also take the nature of your table field into consideration. If you've turned on the Table behaviour using the inspector, you shouldn't just set data inside the table field directly.
Code: Select all
on mouseUp
if fld "runStart" = "" then
put the time into fld "RunStart"
send mouseup to button "Start Counter"
else
global gLineNo
set the itemDelimiter to tab
put the time into tEndTime
put item 1 of line glineNo of field "log" into tStartTime
convert tEndTime from time to seconds
convert tStartTime from time to seconds
put the long id of field "log" into tField
SetCellValue tField, 2, gLineNo, tEndTime
SetCellValue tField, 3, gLineNo, tEndTime - tStartTime
end if
end mouseUp
on SetCellValue pObject, pColumn, pRow, pData
send "revWriteCellValue pObject, pRow, pColumn, pData" to pObject
end SetCellValue
The datagrids in Revolution 3.5 would probabl make this a lot easier, though...
Jan Schenkel.