bellecombe
Instructor
Hi
I need to remove some entries from dict, based on pattern i.e.:
[pre]set keyValueMap [dict create "WidgetTEXT" "T" "WidgetPASSWORD" "P" "defValuesDEFAULTS" "DEFAULT" "defValuesRDB" "R"]
set keyValueMap [dict remove $keyValueMap [join [dict keys $keyValueMap "Widget*"]]]
[/pre]
Although [tt][join [dict keys $keyValueMap "Widget*"][/tt] returns [tt]WidgetTEXT WidgetPASSWORD[/tt], this doesn't works;
instead when hard coded: [tt]set keyValueMap [dict remove $keyValueMap WidgetTEXT WidgetPASSWORD][/tt] works.
What is my mistake?
best regards
I need to remove some entries from dict, based on pattern i.e.:
[pre]set keyValueMap [dict create "WidgetTEXT" "T" "WidgetPASSWORD" "P" "defValuesDEFAULTS" "DEFAULT" "defValuesRDB" "R"]
set keyValueMap [dict remove $keyValueMap [join [dict keys $keyValueMap "Widget*"]]]
[/pre]
Although [tt][join [dict keys $keyValueMap "Widget*"][/tt] returns [tt]WidgetTEXT WidgetPASSWORD[/tt], this doesn't works;
instead when hard coded: [tt]set keyValueMap [dict remove $keyValueMap WidgetTEXT WidgetPASSWORD][/tt] works.
What is my mistake?
best regards