setexitcode

Sets the exit code of MACRO.

setexitcode <exit code>

Remarks

For Windows 98

If MACRO is run from a batch file by the command line "start /w ttpmacro <ttl filename>" (the option /w is necessary), the exit code can be tested by the DOS command "if errorlevel n".

For Windows NT4.0/2000/XP

If MACRO is run from a batch file by the command line "ttpmacro <ttl filename>", the exit code can be tested by the DOS command "if errorlevel n".

Example

----- バッチファイル "test.bat" (Win 98/Me の場合) ------
rem Run MACRO using the "start /w" command.
start /w ttpmacro test.ttl
rem Display message if the exit code is greater than 0.
if errorlevel 1 echo Error!
----- "test.bat" の終わり ---------

----- バッチファイル "test.bat" (Win NT/2000/XP の場合) ------
rem Run MACRO. No need to use the "start" command.
ttpmacro test.ttl
rem Display message if the exit code is greater than 0.
if errorlevel 1 echo Error!
----- "test.bat" の終わり ---------

----- マクロファイル "test.ttl" ----
; Set the exit code to 1.
setexitcode 1
----- "test.ttl" の終わり ----------