Link to home
Start Free TrialLog in
Avatar of arrow
arrow

asked on

Setting the DOS errorlevel in VB5.0

How can I set the good old DOS errorlevel in Visual
Basic 5.0 when the program exists? I have an existing
application (that I can't change) but can call a VB program, and uses the errorlevel for testing.
ASKER CERTIFIED SOLUTION
Avatar of cymbolic
cymbolic

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sbugachevsky
sbugachevsky

You don't have to bother with any flag files.  Here's how you set the errorlevel from a VB program.

Private Declare Sub ExitProcess Lib "kernel32" (ByVal uExitCode As Long)

public sub main()
    call ExitProcess(_put_your_error_code_here)
end sub