You are viewing a plain text version of this content. The canonical link for it is here.
Posted to websh-user@tcl.apache.org by Stefan Mühlebach <st...@gmx.net> on 2004/08/12 20:21:41 UTC

'exit' in WebShell (running as a module in Apache 2.0.x)

Hi

Is there an 'exit'-command (or equivalent) when WebShell is running as a 
module in Apache?

Gruss
Stefan

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


Re: 'exit' in WebShell (running as a module in Apache 2.0.x)

Posted by Andrej Vckovski <an...@netcetera.ch>.
On Fri, 13 Aug 2004, David N. Welton wrote:

> Ronnie Brunner <ro...@netcetera.ch> writes:
>
>> Two options now: implement something in mod_websh or ask the Tcl
>> guys to provide a recursive return that does the trick...
>
> What's needed, I think, is something that just stops
> evaluating/executing the script.

I think that's what Ronnie meant with the recursive return, i..e, the
behaviour you currently have with error returns. In general, I think
there are different levels of "immediate abort" and it depends on how
much control you have over the code. If you have to return from deep
down a call stack you can also use 'error' or return -code error or
so, provided that you don't 'catch' these exception somewhere down the
call stack.

- Andrej.

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


Re: 'exit' in WebShell (running as a module in Apache 2.0.x)

Posted by "David N. Welton" <da...@dedasys.com>.
Ronnie Brunner <ro...@netcetera.ch> writes:

> Two options now: implement something in mod_websh or ask the Tcl
> guys to provide a recursive return that does the trick...

What's needed, I think, is something that just stops
evaluating/executing the script.

-- 
David N. Welton
     Personal: http://www.dedasys.com/davidw/
Free Software: http://www.dedasys.com/freesoftware/
   Apache Tcl: http://tcl.apache.org/
       Photos: http://www.dedasys.com/photos/

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


Re: 'exit' in WebShell (running as a module in Apache 2.0.x)

Posted by Ronnie Brunner <ro...@netcetera.ch>.
Thinking a bit more about it, your problem was probably not solved
(return -code return only makes the calling proc/command return, but
not the complete stack).

In mod_websh we did the following:

 rename exit exit.apache
 proc exit {} {uplevel #0 return}

But unfortunately, that doesn't work as expected either, although it
really looks good ;-(

Two options now: implement something in mod_websh or ask the Tcl guys
to provide a recursive return that does the trick...

> > Is there an 'exit'-command (or equivalent) when WebShell is running as a 
> > module in Apache?
> 
> Because exit would exit the process (which is hrdly what you want),
> you have to use return instead. (Try using return -code return to
> return from within commands or procedures)
> 
> % proc a {} {puts a1;b;puts a2}
> % proc b {} {puts b}
> % a
> a1
> b
> a2
> % proc b {} {puts b;return -code return}
> % a
> a1
> b
> % 
> 
> hth
> Ronnie

----------------------------------------------------------------------
Ronnie Brunner                             ronnie.brunner@netcetera.ch
Netcetera AG, 8040 Zuerich   phone +41 1 247 79 79 fax +41 1 247 70 75

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


Re: 'exit' in WebShell (running as a module in Apache 2.0.x)

Posted by Ronnie Brunner <ro...@netcetera.ch>.
> Is there an 'exit'-command (or equivalent) when WebShell is running as a 
> module in Apache?

Because exit would exit the process (which is hrdly what you want),
you have to use return instead. (Try using return -code return to
return from within commands or procedures)

% proc a {} {puts a1;b;puts a2}
% proc b {} {puts b}
% a
a1
b
a2
% proc b {} {puts b;return -code return}
% a
a1
b
% 

hth
Ronnie
----------------------------------------------------------------------
Ronnie Brunner                             ronnie.brunner@netcetera.ch
Netcetera AG, 8040 Zuerich   phone +41 1 247 79 79 fax +41 1 247 70 75

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