In this dict for example:
How do I change the values of fields forenames, surname, street, city and phone? I tried this way:
dict for {id info} $employeeInfo {
puts "Employee #[incr i]: $id"
dict with info {
puts " Name: $forenames $surname"
puts " Address: $street, $city"
puts " Telephone: $phone"
set [dict get $employeeInfo $id phone] 2341
puts " New Telephone: $phone"
}
}
The phone is set with a new value via:
set [dict get $employeeInfo $id phone] 12345
It doesn’t work. What’s the correct way to do this?
The
phoneelement is under theinfoelement, so:provides that you know the
infoelement.UPDATE
In the
withcontext, you can set the phone element directly, try it: