Re: WHILE and IF
- From: Andreas Leitgeb <avl@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: 17 Jan 2006 12:04:39 GMT
Bryan Oakley <oakley@xxxxxxxxxxxxxxxxxxxx> wrote:
> If you look closely you'll see that you can use "then" if you
> so desire:
> if {$foo} then {do this} else {do that}
This shows that it is a bad idea to define a "then" and/or "else"
command that possibly take no arguments:
% proc then {} {puts ">then<"}
% proc else {} {puts ">then<"}
% if {1} {then} {else}
>else<
% if {1} {then } {else}
wrong # args: no script following "else" argument
% if {1} {then } {else }
>then<
If this weren't so already for a looong time, there would
hardly be any chance of adding such a feature nowadays.
.
- Follow-Ups:
- Re: WHILE and IF
- From: Gerald W. Lester
- Re: WHILE and IF
- References:
- WHILE and IF
- From: delphinuscadmus@xxxxxxxxx
- Re: WHILE and IF
- From: suchenwi
- Re: WHILE and IF
- From: MH
- Re: WHILE and IF
- From: Bryan Oakley
- Re: WHILE and IF
- From: MH
- Re: WHILE and IF
- From: Bryan Oakley
- WHILE and IF
- Prev by Date: Re: Serial comm programme with expect.
- Next by Date: tcl8.5 new operator in expr
- Previous by thread: Re: WHILE and IF
- Next by thread: Re: WHILE and IF
- Index(es):
Relevant Pages
|