Hi,
I have a peculiar problem I am storing all my values in an array say tx($counter) where counter is set from 1 to max. now when I try this with if condition say
if {$something <= 20} {
set counter 1
set tx($counter) $x
incr counter
} else {
set fileid [open c:/command w+]
for {set counter 1} {$counter <= 1000} {incr counter} {
puts $fileid "$tx($counter)"
}
close $fileid
}
the thing is $tx($counter) is not been printed?....what must be the problem.i guess the local variable tx($counter) is been destroyed before else part.how to solve this problem.
thanks
I have a peculiar problem I am storing all my values in an array say tx($counter) where counter is set from 1 to max. now when I try this with if condition say
if {$something <= 20} {
set counter 1
set tx($counter) $x
incr counter
} else {
set fileid [open c:/command w+]
for {set counter 1} {$counter <= 1000} {incr counter} {
puts $fileid "$tx($counter)"
}
close $fileid
}
the thing is $tx($counter) is not been printed?....what must be the problem.i guess the local variable tx($counter) is been destroyed before else part.how to solve this problem.
thanks