Reputation: 1
I have a function which outputs a string with or without spaces. I want to set a variable to the function output. I use the following command:
set name [get_name_function object]
The problem is that if object name contains spaces (i.e. name with spaces), the whole name is putted in curly braces (name is equal to {name with spaces}). How can I get the correct name?
Upvotes: 0
Views: 129
Reputation: 246764
It sounds like get_name_function
is returning a Tcl list, not a string. You might want to use
set name [join [get_name_function object] " "]
Upvotes: 1