TIP: Click on subject to list as thread! ANSI
echo: quik_bas
to: Leonard Erickson
from: MIKE ROSS
date: 2003-06-12 10:29:00
subject: FSM

"Leonard Erickson" wrote to "Jasen Betts" (12 Jun 03  02:37:08)
 --- on the topic of "FSM"

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

One solution is to simply check if the TIMER seconds changed and just
increment a counter. It's a little choppy if one needs fine resolution
but it sidesteps the midnight problem. Otherwise one might use the
number of seconds in a day idea i.e. 86400 seconds / 24 hours:

     SUB Delay (t%)

        StopTime& = TIMER + t%
        DO
           IF LEN(INKEY$) THEN EXIT DO
        LOOP UNTIL (StopTime& - TIMER) MOD 86400 <= 0

     END SUB
(An alternative to checking INKEY$ is to give up the time slice
i.e. increment an elapsed time bargraph or show an hourglass [blech!])

One may also check the bios "midnight" bit and add 86400 but why bother.

 Mike
 ****

... If it's bug free then it's time to make some changes.
--- Blue Wave/DOS v2.30
* Origin: Juxtaposition BBS, Telnet:juxtaposition.dynip.com (1:167/133)
SEEN-BY: 633/267 270
@PATH: 167/133 379/1 106/1 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™.