Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Exiting VFP returning an error level
Message
De
30/11/1999 13:25:03
 
 
À
30/11/1999 11:40:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00296903
Message ID:
00297001
Vues:
27
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform