- EnvSub and its -= equivalent give you the difference between 2 dates, 1600 is a date outside the range, so should cause an error.
- Since you agree that it should cause an error, there doesn't appear to be a bug. Are you saying that AHK is wrong to show an error message, and that that is a 'bug'?
- (Whether errors should be silent or explicit is up for debate. AHK v2 is slightly stricter than AHK v1, and shows more error messages, which I think, on balance, is probably for the best.)
Code: Select all
q:: ;get number of seconds since 1601
vDate := A_Now
vDate -= 1601, Seconds
DllCall("kernel32\GetSystemTimeAsFileTime", Int64P,vIntervalsUTC)
DllCall("kernel32\FileTimeToLocalFileTime", Int64P,vIntervalsUTC, Int64P,vIntervalsLocal)
MsgBox, % vDate "`r`n" (vIntervalsLocal//10000000)
return
- Ah, actually, I see, it appears to be working contrary to what's stated in the documentation.
- The script below works in accordance with what the documentation says. A blank variable, no error message.
- So then this becomes a semantic dispute. While the script is running, AHK behaves as documented. But that bit of the documentation omits to say that if certain errors are spotted in the checking stage, the script will never run.
Code: Select all
w::
vYear := 1600
vDate := A_Now
vDate -= vYear, Seconds
MsgBox, % vDate ;(blank)
return