TIP: Click on subject to list as thread! ANSI
echo: quik_bas
to: Leonard Erickson
from: Jasen Betts
date: 2003-06-13 06:47:30
subject: FSM

Hi Leonard.

12-Jun-03 02:37:08, Leonard Erickson wrote to Jasen Betts

 JB>> Hi Hans.
 HA>> timeout = TIMER + .8

 JB>> try that just before midnight and it'll never time out.

 LE> Yeah. I had to work around the midnight problem on a system (using
 LE> a different language).

 LE> I wound up writing a generic "delay" routine that you fed the
 LE> delay time and it checked to see if the end of the period was past
 LE> midnight and if so adjusted things accordingly. Ugly, but
 LE> necessary.

yeah, another way is to  determine the step-size used by timer and count
N changes... this works fine for dos but AIUI other platforms used different
step-sizes (this is the technique I use when I'm being lazy)

a more reliably accurate way is to use a generic formula

    tmp=(timer-timeout)
    if (tmp - 86400 * int (tmp / &H86400)) <  43200 then goto timeout
    '86400 is 24 hours, 43200 is 12 hours.

should work for timeouts upto 12 hours long...

    (I see Mike Ross has a similar formula...)

another way is to factor the date info the timer value used so that it
never goes backwards... then you can have any size of timeout you want.

 -=> Bye <=-

---
* Origin: Success is a journey, not a destination. (3:640/1042)
SEEN-BY: 633/267 270
@PATH: 640/1042 531 954 774/605 123/500 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.