AnsweredAssumed Answered

vrf Trap exit codes

Question asked by VRFuser on Apr 27, 2000
Response below.

> I'm using "Execute Program" to run some .exe files, which do the actual =
> tests.
> So my HP VEE Program is just an interface between the exe's and the =
> user.
>
> The problem is, the exe give a pass/fail indication via their exit code.
> How is it possible to get this exit-code in VEE.
> I found something in microsofts MSDN libraries (GetExitCodeProcess and =
> RunProgram),
> but I don't know how to use it.
> Has anyone any ideas?


Wouter,

I have my doubts that GetExitCodeProcess will work for you since you
won't have any sort of handle to the process.  I have 2 ideas that may
do what you want though.

First is if you have or can get MKS Toolkit, a Unix-like environment
for PCs, you can create a simple shell script that runs your test and
then either spits the exit code or a message about the exit code to a
file which you can then read with vee.
The script would look like:
rm StatusFile
<your command here, could be a script parameter(s)>
echo $? > StatusFile

Second is to use a .bat file to execute your command and use
ERRORLEVEL to do something based on the exit value, something like:
ECHO OFF
del StatusFile
<your command here, could be a script parameter(s)>
echo $? > StatusFile
IF ERRORLEVEL 4 GOTO LEVEL4
IF ERRORLEVEL 3 GOTO LEVEL3
IF ERRORLEVEL 2 GOTO LEVEL2
IF ERRORLEVEL 1 GOTO LEVEL1
IF ERRORLEVEL 0 GOTO LEVEL0
GOTO END
:LEVEL4
ECHO 4 > StatusFile
GOTO END
:LEVEL3
ECHO 3 > StatusFile
GOTO END
:LEVEL2
ECHO 2 > StatusFile
GOTO END
:LEVEL1
ECHO 1 > StatusFile
GOTO END
:LEVEL0
ECHO 0 > StatusFile
GOTO END
:END


There may be a better way of picking up exit code in higher
dos/windows, I've only got a dos 3.3 manual here, and mainly use MKS
for any such work.

lBill
---------------------------------------------------------------------
This is the "vrf" maillist, managed by Majordomo.  To send messages to
this maillist, just email to "vrf@lvld.hp.com".  Subscriptions and
unsubscriptions are done through the address "vrf-request@lvld.hp.com".
If you need details, just send a message containing the text "help"
to "vrf-request@lvld.hp.com".
---------------------------------------------------------------------

Outcomes