Version 5 of exit

Updated 2002-04-10 00:00:09

http://purl.org/tcl/home/man/tcl8.4/TclCmd/exit.htm

Takes an optional return code (small integer, 0..127) as argument.

LV does exit itself limit the return value to 0-127, or is it the errorCode magic name that is doing the limiting?

From the comp.lang.tcl newsgroup:

Andreas Otto reported "exit 999" to return 231 as a bug.

Pat Thoyts: I notice that 999 is 0x03e7 and 231 is 0x00e7 so provided you restrict exit codes to a maximum of 255 everything should be ok.

Donal Fellows: However it is not a good idea to use exit codes larger than 127, as 128 and higher are used to represent exits due to (unhandled) signals on UNIX. Mind you, if you need more than 128 different exit codes, you've probably got the wrong architecture of software... :^)


Oh, come on:

 rename exit __exit
 proc exit { args } {
    set code [ lindex $args 0 ]
    if { $code == 12345678910111213 } { __exit }
    puts stderr "you and what army?"
 }

It's Tcl guys, rememeber??


Tcl syntax help - Arts and crafts of Tcl-Tk programming - Category Command