Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 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"
}