Re: Returns error code on success?
"Nick Sabalausky" <[email protected]> Fri, 04 Feb 2005 09:12:12 -0700
| Newsgroups | gmane.comp.tools.aap.devel |
|---|---|
| Message-ID | <[email protected]> |
> For Windows 9x we could remove the set command completely. What is more > important: that %AAPARGS% is cleared or that the exit code is OK? I just looked into seeing if it was possible to save the errorlevel after running python, and then restore it after clearing AAPARGS, and it is possible... But, it looks like that's not even necessary. Apperently, Win9x does *not* change the errorlevel when issuing a set command like NT/XP does. To test it, run the following batch file (on a *fresh* command-prompt): @echo off echo Errorlevel: %errorlevel% set AAPARGS= echo Errorlevel: %errorlevel% set AAPARGS=fs echo Errorlevel: %errorlevel% set AAPARGS= echo Errorlevel: %errorlevel% On my WinXP Pro machine I get: Errorlevel: 0 Errorlevel: 1 Errorlevel: 1 Errorlevel: 1 And on my Win98 machine I simply get: Errorlevel: Errorlevel: Errorlevel: Errorlevel: Note also that NT/XP only sets the errorlevel to 1 if AAPARGS is not yet defined, otherwise it sets it to 0. So it seems that the slightly modified aap.bat I posted earlier should work perfectly fine on both 9x and NT/XP. FYI, not that we seem to need it, but the errorlevel can be saved and restored like this: set saveerror=%errorlevel% rem Do stuff that messes with the errorlevel set errorlevel=%saveerror% ------------------------------------------------------- This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl