FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for CA-Clipper Catching errorlevel from old dos app
Posts: 37
Joined: Sat Oct 22, 2005 02:15 PM
Catching errorlevel from old dos app
Posted: Tue May 16, 2006 01:54 PM
Hello all
How can I determine what error code a dos app returns. I’m using the blat command line mailer. When the email doesn’t get sent the app returns an non zero errorlevel code. Is there a way to get that code without writing a second app to trap it and pass it along to the main app through a file or something. For exaple

nError := WaitRun(‘BLAT.EXE .\BODY.HTM –s “Test email 11” –t dummy@dummy.dum –html  -noh2 –try 3’)


Also can the command be passed to WaitRun through a var.
Thank you
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Catching errorlevel from old dos app
Posted: Tue May 16, 2006 02:15 PM

Try ErrorLevel() function.

EMG

Posts: 37
Joined: Sat Oct 22, 2005 02:15 PM
Catching errorlevel from old dos app
Posted: Tue May 16, 2006 02:36 PM
Here is a beeter example.

// erelvl.prg
#include "fivewin.ch"

PROCEDURE Main()
  LOCAL nErr

  nErr := WaitRun("tst2.exe")
  MSGInfo(nErr)
  MSGInfo(errorlevel()) // returns 0
RETURN

// tst2.prg
? "hello to you"
errorlevel(1)
inkey(3)
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Catching errorlevel from old dos app
Posted: Tue May 16, 2006 02:54 PM

Sorry, I don't think that ErrorLevel() function can help you.

EMG

Continue the discussion