Jump to content

@error max value?


Xand3r
 Share

Recommended Posts

$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

Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...