Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -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
|
||||
|
|
@ -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"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue