tcl-mod_dtcl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@dedasys.com (David N. Welton)
Subject Re: terminating script
Date Sat, 26 Jan 2002 17:01:22 GMT

namespace eval ::foo {
    proc localexit { } {
	puts 1
	namespace delete ::foo
	error "Performing Local Exit" "Local Exit" LOCALEXIT
    }

    if { [catch {
        # your code goes here
	puts a
	puts b
	localexit
	puts c
    } err] } {
	if { [info exists errorCode] && $errorCode == "LOCALEXIT"} {
	    puts exiting
	} else {
	    error $errorInfo
	}
    }
}

You could probably do something like this, although I don't think it's
very elegant...


-- 
David N. Welton
   Consulting: http://www.dedasys.com/
Free Software: http://people.debian.org/~davidw/
   Apache Tcl: http://tcl.apache.org/
     Personal: http://www.efn.org/~davidw/

---------------------------------------------------------------------
To unsubscribe, e-mail: mod_dtcl-unsubscribe@tcl.apache.org
For additional commands, e-mail: mod_dtcl-help@tcl.apache.org


Mime
View raw message