Nov 19, 2003 #1 syskplim Technical User Nov 17, 2003 46 MY i only know that ax=4c00h/ah=4ch is for termination but why someone put 4C01h and 4C02h in their program?
i only know that ax=4c00h/ah=4ch is for termination but why someone put 4C01h and 4C02h in their program?
Nov 19, 2003 #2 zeitghost Programmer Oct 30, 2003 378 GB Hi. 4c00 gives a dos return code of 00 4c01 gives a dos return code of 01 4c02 gives a dos return code of 02. The return code can be tested in a batch file to determine how the program terminated. This is done using the IF ERRORLEVEL construct. rgds Zeit. Upvote 0 Downvote
Hi. 4c00 gives a dos return code of 00 4c01 gives a dos return code of 01 4c02 gives a dos return code of 02. The return code can be tested in a batch file to determine how the program terminated. This is done using the IF ERRORLEVEL construct. rgds Zeit.
Nov 19, 2003 Thread starter #3 syskplim Technical User Nov 17, 2003 46 MY lets say my test.com has 3 functions each returns 4C01, 4C02 and 4C03. then i can put ERRORLEVEL command in batch like bellow? ----------------------------TOF @ echo off test if errorlevel 1 goto work1 if errorlevel 2 goto work2 if errorlevel 3 goto work3 :work1 . . goto end :work2 . . goto end :work3 . . :end ------------------------EOF Upvote 0 Downvote
lets say my test.com has 3 functions each returns 4C01, 4C02 and 4C03. then i can put ERRORLEVEL command in batch like bellow? ----------------------------TOF @ echo off test if errorlevel 1 goto work1 if errorlevel 2 goto work2 if errorlevel 3 goto work3 :work1 . . goto end :work2 . . goto end :work3 . . :end ------------------------EOF
Nov 19, 2003 #4 zeitghost Programmer Oct 30, 2003 378 GB Yes, you've got the idea! programs generally return 00 to indicate success, with any other return value indicating some sort of error has occurred. This is what I tend to do when writing utilities. However, you are free to use it as it suits you. Many dos utilities were written that gave return values that allowed batch files to access system functions. rgds Zeit. Upvote 0 Downvote
Yes, you've got the idea! programs generally return 00 to indicate success, with any other return value indicating some sort of error has occurred. This is what I tend to do when writing utilities. However, you are free to use it as it suits you. Many dos utilities were written that gave return values that allowed batch files to access system functions. rgds Zeit.
Nov 19, 2003 #5 AirCon IS-IT--Management Apr 5, 2003 860 ID Just want to add a comment about this Many dos utilities were written that gave return values that allowed batch files to access system functions It is also a good reason to do that. So the user knows what is the status Regards -- AirCon -- Upvote 0 Downvote
Just want to add a comment about this Many dos utilities were written that gave return values that allowed batch files to access system functions It is also a good reason to do that. So the user knows what is the status Regards -- AirCon --
Nov 19, 2003 Thread starter #6 syskplim Technical User Nov 17, 2003 46 MY clear! Thankx Zeit, thnkx AirCon. Upvote 0 Downvote