hi
im new in tcl, im not a programmer, so i have many many problems...
my problem is finding the value of a numerical variable in a string.. how can i do this?
the string match command seems not to work..
thanks, kukelyk
There are probably more elegant ways but I use set and catch. Let's say you want to know if a variable, a, has a value. A statement, set a will return the value if it exists, or an error if it doesn't. You can catch the error: catch {set a} and that returns a 0 if there is no error and 1 if there is. So, for example: if [catch {set a}] {
#there was an error; a is not set
} else {
#there was no error; a has a value
}
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.