TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Leslie Rhorer
from: Mike Bilow
date: 1996-05-11 17:17:10
subject: External Errorlevel

Leslie Rhorer wrote in a message to All:

 LR>         Great!  So what's the problem?  The problem is, I
 LR> (and some of my clients) would like to have an EXTERNAL
 LR> event cause Bink to exit with errorlevel 80 (or whatever). 

This is more of an issue for the BINKLEY echo, but I'll answer your
question here.  Of course, OS/2 batch programming is kind of marginal for
this echo...

To make Binkley drop out with a particular errorlevel, create a file named
BTEXITee.nn in the flags directory, where "ee" is the desired
errorlevel in hexadecimal and "nn" is the node number in
hexadecimal of the Binkley instance:

c:
cd c:\bink\squish
squishp in out squash link %1 %2
cd c:\bink\areafix
afp ec
rem  if not errorlevel 1 goto L_SKIPAF
cd c:\bink\squish
squishp in out squash link %1 %2
:L_SKIPAF
echo SQ_ALL > c:\bink\flags\BTRESCAN.01
mutex /S=UUGATE /T=0 c:\uugate\futoss.cmd -y2
if errorlevel 145 echo SQ_ALL > c:\bink\flags\btexit47.01

My script above (which is in actual use) forces Binkley node 01 to rescan
after the mail has been processed, and then triggers an errorlevel 71 (hex
47) exit if UUCP mail is pending to go out.

 LR> Exiting the internet dialer is a piece of cake.  I simply run a 
 LR> kill routine which looks for PPP.EXE and kills it.

Note that, at least as of APAR IC12657 (available from me as IC12657.ZIP or
from ftp://ps.software.ibm.com/ps/products/tcpip/v3.0os2), you can use
PPPKILL.EXE or SLIPKILL.EXE to accomplish this directly.

 LR> Is there any way to EXTERNALLY force a process to close with a 
 LR> given errorlevel?

Not in general, but Binkley provides for your specific situation.

Another tip of value in debugging batch programs: set the PROMPT to
"[$r $p]" so that you get a display of the last return code.
 
-- Mike


--- 
* Origin: N1BEE BBS +1 401 944 8498 V.34/V.FC/V.32bis/HST16.8 (1:323/107)
SEEN-BY: 50/99 270/101 620/243 711/401 409 410 413 430 808 809 934 955
SEEN-BY: 712/407 515 517 628 713/888 800/1
@PATH: 323/107 396/1 270/101 712/515 711/808 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.