Nov 5, 2004 #1 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
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
Nov 5, 2004 #2 marsd IS-IT--Management Apr 25, 2001 2,218 US 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 Upvote 0 Downvote
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
Nov 5, 2004 Thread starter #3 bebig Technical User Oct 21, 2004 111 US I tried that...but I could get answer...hum... 1 2 3 4 can I use array??? Upvote 0 Downvote
Nov 5, 2004 Thread starter #4 bebig Technical User Oct 21, 2004 111 US sorry, it works.. Upvote 0 Downvote
Nov 8, 2004 #5 baronhills Programmer Nov 8, 2004 1 SE 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 Upvote 0 Downvote
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