Re: Combining a variable with a counter?
- From: Schelte Bron <nospam@xxxxxxxxxx>
- Date: Thu, 14 Jul 2005 00:23:24 +0200
Christoph Hörterer wrote:
> in my script, I got many similar variables
> task1 task2 task3 task4 ....
>
> I'd like to address them in a loop with something like
>
> $task$i
>
And then there's the method that most people always seem to forget:
for {set i 1} {$i <= 4} {incr i} {
upvar 0 task$i task
puts $task
}
But this is just for completeness. Go with arrays unless you have a
real good reason not to.
Schelte.
--
set Reply-To [string map {nospam schelte} $header(From)]
.
- References:
- Combining a variable with a counter?
- From: Christoph Hörterer
- Combining a variable with a counter?
- Prev by Date: Re: Combining a variable with a counter?
- Next by Date: Re: Combining a variable with a counter?
- Previous by thread: Re: Combining a variable with a counter?
- Next by thread: Re: Combining a variable with a counter?
- Index(es):
Relevant Pages
|