| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | FSM |
-> 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
I usually write it as:
SUB Delay (D!)
T! = TIMER
DO
IF TIMER < T! THEN T! = T! - 86400
LOOP UNTIL TIMER >= T! + D!
END SUB
Of course, the exclamation points can be omitted if the default
variable-type is real numbers.
dow
--- Platinum Xpress/Win/WINServer v3.0pr5
* Origin: The Bayman BBS,Toronto, (416)698-6573 - 1:250/514 (1:250/514)SEEN-BY: 633/267 270 @PATH: 250/514 140/1 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™.