I'm trying to take measure of time, then have one second further and one second back - so in total it should display 3 clocks. When the current clock reaches 59, the future clock should show 00 instead of 60. Problem is, it drops to 0 and never moves again. I think it just never resets the statement value, but I have no idea where should I go from there. Code:
[MeasureNow]
Measure=Time
;default format is %H:%M:%S so it's fine
[Measure-1s]
Measure=Time
Timestamp=([MeasureNow:Timestamp]-1)
DynamicVariables=1
[Measure+1s]
Measure=Time
Timestamp=([MeasureNow:Timestamp]+1)
DynamicVariables=1
Altough NighthawkSLO's solution with timpstamp is the best, you can also make it without the TimeStamp option. For that, in your initial code, you have to:
1. Remove the IfAboveValue, IfAboveAction, IfBelowValue and IfBelowValue options from the [MeasureSec+] measure. You don't need them. Instead modify the Formula of this measure to: Formula=(( MeasureSec1 + 1 ) % 60 ). With the original formula you'll have troubles when the number of seconds is 59: in this moment the (MeasureSec1+1) formula returns 60, while =(( MeasureSec1 + 1 ) % 60 ) returns 0 (% is the remainder of the division).
2. Also modify the Formula of the [MeasureSec-] measure to: Formula=((( MeasureSec1 - 1 ) < 0 ) ? 59 : ( MeasureSec1 - 1 )).
And two more things: first, you can add the leading zeros to the seconds and minutes. To do that, remove the #, from the [MeasureMin1] and [MeasureSec1] measures and add the following options to the [MeasureSec-] and [MeasureSec+] measures: