Sign in to follow this  
Followers 0
SandyTipper

"Exit <anything>" always results in %ERRORLEVEL% 0

4 posts in this topic

Using AutoIt 3.1.1.0

Either intyerpreted or compiled, I am gettittin 0 as en exit value from any script, regardless of the value given to Exit.

What's wrong?

Simple example, to return the amount of memory in GB as an integer.

$memstats = MemGetStats()

$mem = $memstats[1] / (1024*1024)

$GB = Round($mem, 0) ; should be 1 if memory > 500MB and < 1.5 GB

MsgBox(0,"",$GB)

Exit $GB

Run on a 1 GB system, the MsgBox shows 1, but the value of %ERRORLEVEL% is 0.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

uh one quick question what is the Exit $gb for? do u just enjoying putting a variable at the end for no reason :P

Edited by thatsgreat2345

Share this post


Link to post
Share on other sites

Ah, didn' "get" the start /wait necessity.

Alreadly figured out how to get text:

for /f %x in ('somescript.exe') do set VAR=%x

same idea,

THANKS!!!

(oh, thatsgreat, that's how to return a numeric value in errorlevel)

Share this post


Link to post
Share on other sites

o lol gotcha i havent worked with arrays alot either and error levels so yeah

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