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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2 Dimensional Arrays

Status
Not open for further replies.

carlosAlberto

IS-IT--Management
Oct 9, 2001
109
GB
HI,

How do i go about setting up 2 dimensional arrays in TCL???

Is this even possible?????
 
yep

for {set i 0} {$i < 10} {incr i} {
for {set j 0} {$j < 10} {incr j} {
set myArray($i,$j) [expr {$i + $j}]
}
}

This is a trick: array IS unidimensional and you can't add blanks inside parenthesis.
In fact myArray(1,1) IS myArray(&quot;1,1&quot;).

ulis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top