Retrieving an Element of an Array: Difference between revisions
Content deleted Content added
→{{header|C}}: + AWK |
→{{header|Tcl}}: xref to lists |
||
Line 453:
=={{header|Tcl}}==
All arrays in Tcl are associative. If "key" is the variable that holds the key of the element to be retrieved, then
If you are looking for a collection of values that are indexed by number, you want a list. List are indexed into with the <tt>lindex</tt> command:
▲ set result $array($key)
<lang tcl>set result [lindex $list $index]</lang>
=={{header|Toka}}==
|