Add all the A tasks

This commit is contained in:
Ingy döt Net 2013-04-10 14:58:50 -07:00
parent 2dd7375f96
commit 051504d65b
1608 changed files with 18584 additions and 0 deletions

View file

@ -0,0 +1,16 @@
array set myAry {
# list items here...
}
# Iterate over keys and values
foreach {key value} [array get myAry] {
puts "$key -> $value"
}
# Iterate over just keys
foreach key [array names myAry] {
puts "key = $key"
}
# There is nothing for directly iterating over just the values
# Use the keys+values version and ignore the keys

View file

@ -0,0 +1,16 @@
set myDict [dict create ...]; # Make the dictionary
# Iterate over keys and values
dict for {key value} $myDict {
puts "$key -> $value"
}
# Iterate over keys
foreach key [dict keys $myDict] {
puts "key = $key"
}
# Iterate over values
foreach value [dict values $myDict] {
puts "value = $value"
}