General information
Category:
Windows API functions
Title:
Exiting VFP returning an error level
Based on the info I found in the FAQ (#443 by Ed Rouh), I tried creating a RetTest.exe and and associated BAT file to capture an error level. Can anyone suggest what I might be doing wrong as no matter what I do, there does not appear to be anything returned. I say this because my BAT file always echos "Nothing was returned". Any suggestions would be greatly appreciated.
TIA - Isaac
Here is my prg and bat files ...
************************************************
** RetTest - Testing for returned error level
LOCAL lnReturnVal
lnReturnVal = 1
DECLARE ExitProcess in Win32API INTEGER ExitCode
=ExitProcess(lnReturnVal)
RETURN
************************************************
REM Here is my bat file called test.bat
@echo off
RetTest
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
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only