Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TCL (vertical , horizonal)

Status
Not open for further replies.

bebig

Technical User
Oct 21, 2004
111
US
I am trying to make

set a {1, 2, 3, 4}
puts $a

result is 1,2,3,4

I want to change this to

1
2
3
4

what command do I need to use it?
thank you
 
Code:
set list {1,2,3,4}
1,2,3,4
(bin) 53 % regsub -all "," $list " " list
3
(bin) 54 % set list
1 2 3 4
(bin) 55 % for {set p 0} {$p < [llength $list]} {incr p} {
                puts "[lindex $list $p]"
}
1
2
3
4
 
I tried that...but I could get answer...hum...

1 2 3 4

can I use array???



 
Hey.
I think i know what you mean.

set a "1\n2\n3\n4"
puts $a

Result:
1
2
3
4

It's that right? :)
//DoXy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top