Author: RickOShay
Subject: Elapsed time 00:00:00 – timer calculation error
Posted: Sun Apr 29, 2012 8:24 am (GMT -7)
Topic Replies: 0
I have a simple subroutine that calculates the elapsed time in Hours Minutes and Seconds.
The routine runs every 1000 ms using a timer. Variable [P1TimeE] = Player 1 Time elapsed.
A similar routine used to work in the previous version of Neobook – now I get weird problems.
I saw somewhere that the Maths calc has changed in 5.7.1
So what am I doing wrong? I’ve tried many different methods and each time I get the wrong result.
| Code: |
| Math "[P1TimeE]+1" "0" "[P1TimeE]"
. convert elapsed time into hours, minutes & seconds for display . take total elapsed seconds and divide by # secs in an hour to get hrs .take seconds in elapsed hours and subtract from total elapsed time .take remainder and divide by secs in hour to get mins .get remainder secs .change display in case secs = 60 [b].add extra zero in display[/b] . change mins and hrs in case mins = 1 hr .add extra zero in display .add extra zero in display .output string |
_________________
There’s no place like 127.0.0.1