Not sure how this would work when not using a 24 hour clock. I think you still have to have some sort of IF/ENDIF when rolling from 12:00 to 1:00.
Albert
>There is a lot of IF in the code to form a ring. Typical codemonkey approach. :)
>
>This could be done quicker with the following formula using modulo:
>
>
>lnHours = 24
>lnNewHour = (lnOldHour+lnChange)%lnHours
>
>try
>
>clear
>lnOldHour = 24
>lnHours = 24
>lnd = 1
>FOR lnchange = 1 TO 25
>lnOldHour = (lnOldHour-lnd)%lnHours
>?lnOldHour
>ENDFOR
>
>or
>
clear
>lnOldHour = 24
>lnHours = 24
>lnd = 1
>FOR lnchange = 1 TO 25
>lnOldHour = (lnOldHour+lnd)%lnHours
>?lnOldHour
>ENDFOR
>
>
>new you loop between 1 and 00
>
>lots of if less :)
>
>and even if somebody enters 55 -> the modulo will fit it.
>
>Lutz