julian9909
Technical User
The following lines of code:-
set x "a b c"
foreach j $x {
puts $j
puts $x
}
produce the following result:
a
a b c
b
a b c
c
a b c
I would expect the following lines of code to
produce the same result.
proc srtlenlist {args} {
foreach j $args {
puts $j
puts $args
}
return $j
}
srtlenlist "a b c"
It actually produces the following:-
a b c
{a b c}
Can someone explains this?
thanks
julian9909
set x "a b c"
foreach j $x {
puts $j
puts $x
}
produce the following result:
a
a b c
b
a b c
c
a b c
I would expect the following lines of code to
produce the same result.
proc srtlenlist {args} {
foreach j $args {
puts $j
puts $args
}
return $j
}
srtlenlist "a b c"
It actually produces the following:-
a b c
{a b c}
Can someone explains this?
thanks
julian9909