I just made a minor change to my game and went to test it and, after my game completely stopped working I tracked it down to the fact the the Millisecs() function on my machine is now returning negative values such as -1989814108.
Anyone have any ideas? Help!!
If I run this, I get negative numbers being reported for Millisecs():
Graphics 640,480
SetBuffer BackBuffer()
ms% = MilliSecs()
DebugLog "Millisecs() = " + ms%
While Not KeyHit(1)
Cls
Flip
Wend
End
Sorry, I rebooted my machine and now I am getting positive values again. Any ideas what would be happening, though, when this occurs?
Yes. The millisecs counter is technically an unsigned int, while blitz only supports signed ints. When you pass the 2bil millisec mark, it swaps back to -2bil.
Solution: never depend on millisecs() being a positive number.
just don't let the system run for 24 days and there are no probs *ggg*
to solve problems with time differences there is no problem anyway ( ok 2 special cases. 1 where you are around the 2 billion border and 1 where you are around 0 when coming from negative. but they both only happen once so normally aren't causing problems )