Deutsch   English   Français   Italiano  
<va8be7$j3e0$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!3.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: et99 <et99@rocketship1.me>
Newsgroups: comp.lang.tcl
Subject: Re: try command error codes, where documented?
Date: Thu, 22 Aug 2024 14:43:34 -0700
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <va8be7$j3e0$1@dont-email.me>
References: <v9o5ov$1h561$1@dont-email.me> <v9p9u9$1poub$1@dont-email.me>
 <v9piak$1qmrc$1@dont-email.me> <v9uu53$2paeg$2@dont-email.me>
 <va3f7m$3j3ao$1@dont-email.me> <99917242168821001@llp>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 22 Aug 2024 23:43:36 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="9e54bbb846b70ce3b5fa83f3819add61";
	logging-data="626112"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19u2cIbwuoYHC3VcMeAdbfo"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:AG0THAO5nfjhBfE931Rg7asuFjk=
Content-Language: en-US
In-Reply-To: <99917242168821001@llp>
Bytes: 1852

On 8/20/2024 10:08 PM, clt.to.davebr@dfgh.net wrote:

> 
> I'm kind of amazed it works too, but it is very nice that it does. My most common use for try {...} finally {...} is to close a file regardless of any errors after reading and maybe processing the contents inside the try script.
> 
> daveb
> 
> 
> 

Well, I *finally* decided to read sections 11.2-3 in Ashok's great Tcl book and the text and examples there has cleared up everything for me.

That explains how the try command can execute the finally clause *after* the execution of the return command. It's because try gets to do whatever it wants with the return code of 2 that the return command itself returns.

-e