Is it permissible to set a timer to negative values? I didn't find a hint in the manual, so I tried. It seemed to work, and there was also an overflow at 2^32-1 (tested under Windows). But in practice there are strange effects when starting with certain values. With full seconds it works. But with values between full seconds it doesn't. GetTimer() returns alternately correct and incorrect values at one-second intervals.
Here is the output of GetTimer() in 100ms intervals for four time values:
Code: Select all
StartTimer(1)
offset=(-500)
ResetTimer(1, offset)
For i=1 To 18
DebugPrint(GetTimer(1))
Wait(100,#MILLISECONDS)
Next
Code: Select all
-1000 -800 -500 -200
-914 -710 -405 -101
-814 4294357 -304 -1
-714 4294457 -204 99
-614 4294557 -104 199
-514 4294657 4294963 299
-414 4294757 4295063 4295366
-314 4294857 4295163 4295466
-214 4294957 4295263 599
-114 4295057 4295363 699
-14 190 496 799
86 290 596 899
186 4295357 696 999
286 4295457 796 1099
386 4295557 896 1199
488 4295660 4295963 1302
590 4295761 4296063 4296370
691 4295862 4296163 4296471
Ralf