Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Exiting VFP returning an error level
Message
From
30/11/1999 13:25:03
 
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00296903
Message ID:
00297001
Views:
26
Beutiful! Thanks Ed. I now know how to make it work and what I should read up on to better understand it.

-Isaac


>>REM Here is my bat file called test.bat
>>@echo off
>>
>>RetTest
>
>In addition to the other message, this is not the correct mechanism to check the errorlevel return value. Instead, you should use an IF branch based on the errorlevel code - it is a number, not a string.
>
>
IF ERRORLEVEL 2 GOTO TWORHIGHER
>IF ERRORLEVEL 1 GOTO EXACTLYONE
>REM if it falls through to here, a zero was returned
>echo The big zip
>goto end
>:TWOORHIGHER
>echo something bigger than 1
>goto end
>:EXACTLY1
>echo It came back 1
>:END
>
>This is documented in the Windows Help file, and the behavior is consistent since DOS 2.0 for examinign an error level.
>
>>goto answer%ERRORLEVEL%
>>
>>:answer0
>>echo Zero was returned
>>goto end
>>
>>:answer1
>>echo Negative one was returned
>>goto end
>>
>>:answer
>>echo Nothing was returned
>>goto end
>>
>>:end
Previous
Reply
Map
View

Click here to load this message in the networking platform