Answers for "TCL get array indices"

0

TCL get array indices

# Tcl - Tool Command Language
# Make an example array:
for {set i 0} {$i < 10} {incr i} {
	set Arr($i) [expr $i*$i];
};
set Arr(Dave) "This Array belongs to Dave";
# Get Array index values by using the "array names <arrayName>" command:
puts [array names Arr]

# Output: Dave 8 4 0 9 5 1 6 2 7 3
Posted by: Guest on December-17-2020

Browse Popular Code Answers by Language