Sign in to follow this  
Followers 0
Xand3r

@error max value?

2 posts in this topic

$a is positive , @error is negative...

#include<Date.au3>
$a = _DateDiff("s" , _NowCalc() , "2284/06/19 12:11:48")
SetError($a)
MsgBox(0 , $a , @error)


Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

It appears the @error is trying to be assigned the number of seconds in 273 years which is greater than the signed integer limit: Signed: −2,147,483,648 to +2,147,483,647, -(2^31) to (2^31-1).

Evidently, _DateDiff() function returns a signed integer.

Edit: Replaced test. Looks like the SetError() function's 1st parameter is a signed integer.

A test.

#include<Date.au3>

$a = _DateDiff("s", "2010/09/10 10:00:00", "2078/09/28 13:14:06")
SetError($a)
$b = @error
ConsoleWrite($a & " " & $b & " " & Hex($b) & @CRLF)

$a = _DateDiff("s", "2010/09/10 10:00:00", "2078/09/28 13:14:07")
SetError($a)
$b = @error
ConsoleWrite($a & " " & $b & " " & Hex($b) & " <== Top signed integer limit." & @CRLF)

$a = _DateDiff("s", "2010/09/10 10:00:00", "2078/09/28 13:14:08")
SetError($a)
$b = @error
ConsoleWrite($a & " " & $b & " " & Hex($b) & @CRLF)

$a = _DateDiff("s", "2010/09/10 10:00:00", "2078/09/28 13:14:09")
SetError($a)
$b = @error
ConsoleWrite($a & " " & $b & " " & Hex($b) & @CRLF)

#cs
Returns:-
2147483646 2147483646 7FFFFFFE
2147483647 2147483647 7FFFFFFF <== Top signed integer limit.
2147483648 -2147483648 80000000
2147483649 -2147483648 80000000
#ce
Edited by Malkey

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0