TIP: Click on subject to list as thread! ANSI
echo: 80xxx
to: JOHN GARDENIERS
from: BARRY BLOCK
date: 1997-06-06 13:44:00
subject: DOS return code (Errorlevel)

Hello John, ok, I found what I was looking for finally!
 JG> According to RB's interrupt list INT 21h, function 4Dh will retrieve
 JG> the return code from the previous program. Using straight DOS v6.22 (no
 JG> Windows or anything else on the system) this doesn't work for me. :-(
 JG> Using a small program which exits with a known errorlevel I have no
 JG> problem using that number from within a batch file. Why can't I fetch
 JG> that same number with another program, or is that function only 
vailable
 JG> when spawning a child process?
Here is some code you can modify/learn from?
GetError.com v1 by Brett Warthen.
A tsr to return the last external errorlevel.
section 1 of 1 of file geterror.zip  
begin 644 geterror.zip
M4$L#!!0``@`(`"INQB*$'(.(/0```$`````+````1DE,15])1"Y$25H%0$$*
M@"`0O`O^84X=>TSU`=$I@M6-6>O]P;)LT"'.T>%RBYC!\-?L)*S)P>^:72
M5Y3H"']5B07-:TX_4$L#!!0``@`(`(.P`0_XU134T`4``%$7```,````1T54
M15)23U(N05--O5C?;]LV$'XWX']@3U>@F%\4@TI2#W,P#$F:=0'294B"]F$H
M#-H\6VIE4B.IV.Y?/QXEV9*E*,G:5`_^09''[^Z[7V3*%PAOW@3AT6&_-U,"
MP>!BB=+V>]R8;(DP,V,:#T3QC?EWOZ?T`D+&HG[OI-\SEFL[!O=\7J8`L8QM
MS)/XJYMW`H);#EPC=_/BA>0VTPCY(Z8P>'=Q=W%S,
MP70#9QJMA8].>H1RT.\E*!HY.#[_.0`>XBA+E*$K6*Y0)B`RK3,-=*V@.4`JR"M]>W
M`8TL817%LPA6"*LX2Q53C:&G8(\!$A,]ZF1B68;$@(>3_P77)V
MEOLW0T-FAR7_@F!HT.9Q!D+)@74:&^28LPKWD&'=JYHUDC%YL2,8JV?F";
M71IO3''N;^Y,A/4N[UAS<
M442]1[>#>W?RYFA)98_XI&^*?.D@=Z!ZKI^6KAZ1NU,M43-J?YK)+0E"QCJ3
MDKQ';7-_=08ZO3V_O*R*$;$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.W",=:7LH@1#]7GE9!TPVNKB)FG6
M=@TXV7R]D?RWAMV8@WWX!U!+`0(4`!0``@`(`"INQB*$'(.(/0```$`````+
M``````````$`(`````````!&24Q%7TE$+D1)6E!+`0(4`!0``@`(`(.P`0_X
MU134T`4``%$7```,``````````$`(````&8```!'151%4E)/4BY!4TU02P$"
M%``4``(`"`#HK0$/5$?D=,D!``!!`P``#``````````!`"````!@!@``1T54
?15)23U(N1$]#4$L%!@`````#``,`K0```%,(``````
`
end
sum -r/size 64871/3235 section (from "begin" to "end")
sum -r/size 64266/2326 entire input file
Kind regards, Barry
--- Terminate 4.00/Pro
---------------
* Origin: EBO-BBS A'dam +31-20-6002828 (2:280/901.42)

SOURCE: echomail via exec-pc

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™.