Hello
Assume we have a set of parameters
like
set LA1 3
set LA2 4
.
.
.
set LA10 10
and we wanna call them in , into a script like:
set {for i 1} {$i <=10 } {incr i } {
set b($i) [expr $LA$i+1]
}
[expr $LA$i+1] does not work , any suggestions that i can call in LA1, LA2,... LA10 automatically into my code?? I know that I can put them into an array and do it but anything but that is available ?
Thanks
RG.
Parametric Studies
Moderators: silvia, selimgunay, Moderators
Re: Parametric Studies
try this:
set LA2 4
set LA3 12
set b {}
for {set i 1} {$i <=2 } {incr i 1} {
set val "LA[expr $i+1]"
lappend b [subst $$val]
}
puts $b
set LA2 4
set LA3 12
set b {}
for {set i 1} {$i <=2 } {incr i 1} {
set val "LA[expr $i+1]"
lappend b [subst $$val]
}
puts $b