Wait... before we spend another second (or I in checking code of this coding exercise), can someone review for me the practical benefits it might serve?
Steve, you said yourself you use a different system for autosave, one I can appreciate for it's transparency.
Wait... maybe I can for myself, using it to calculate date and time differences. My code that I worked out yesterday was pretty inefficient counting one by one the days until I reach the later date. Converting to seconds, subtracting seconds and then converting to days hours minutes secs.... might be easier or more efficient.
I haven’t used it for a time stamp before (which is why there was so many little glitches to work out); what I use all the time is the ExtendedTimer. QB64 has 2 ways we can track time — TIME$ and TIMER. For most usages, I find myself using TIMER a lot more than I would TIME$ (it’s hard to add and subtract hours, minutes, and seconds...), but TIMER has one great flaw...
MIDNIGHT!!
Start a program at 11:59:59 PM (86399 seconds), and wait 10 seconds to do something.... and you’ll wait forever with IF TIMER > StartTime + 10 THEN....
Your timer goes back to 0 at midnight, so you’ll never pass (86409 seconds) — putting your program into an endless loop.
Thus, I added ExtendedTimer. It tracks time
with days, months, years, so midnight is no longer an issue. Where “IF TIMER > StartTime + 10 THEN....” fails at midnight, “IF ExtendedTimer > StartTime + 10 THEN...” doesn’t.