Re: Accessing Array Elements within [if-else]
- From: "slebetman@xxxxxxxxx" <slebetman@xxxxxxxxx>
- Date: 8 Feb 2007 07:17:33 -0800
On Feb 8, 7:25 pm, Neil Madden <n...@xxxxxxxxxxxxx> wrote:
slebet...@xxxxxxxxx wrote:
On Feb 8, 11:01 am, "SuNnY" <esu...@xxxxxxxxx> wrote:
if {$Counter==0} {
for {set i 0} {$i<=$Counter} {incr i} {
This piece of code is is exactly equivalent to:
set i 0
That's not true -- the condition of the [for] is checked after the
iteration, so it will still do one loop (i.e., Port(0) should exist):
Well, it IS true since doing exactly one loop means you can do it
without a for loop.
% for {set i 0} {$i <= 0} {incr i} { puts "i = $i" }
What I was saying before was, your code is exactly equivalent to:
set i 0; puts "i = $i"
see, you can remove the for loop surrounding your { puts "i = $i" }.
.
- Follow-Ups:
- Re: Accessing Array Elements within [if-else]
- From: Neil Madden
- Re: Accessing Array Elements within [if-else]
- References:
- Accessing Array Elements within [if-else]
- From: SuNnY
- Re: Accessing Array Elements within [if-else]
- From: slebetman@xxxxxxxxx
- Re: Accessing Array Elements within [if-else]
- From: Neil Madden
- Accessing Array Elements within [if-else]
- Prev by Date: Re: Accessing Array Elements within [if-else]
- Next by Date: Re: Accessing Array Elements within [if-else]
- Previous by thread: Re: Accessing Array Elements within [if-else]
- Next by thread: Re: Accessing Array Elements within [if-else]
- Index(es):
Relevant Pages
|