the above code gives me an error saying NO SUCH VARIABLE, true because it not been set yet but in my other procedures it's being set and i dont want to process the above procedure if the $variable have been set or already exist. Also, that $variable is dynamic (it's created at runtime)
OK, first thing. If the variable is being set by other commands, then you need to make sure, it is being set globaly (IE, so it can been seen, outside of this proc command).
SO, if you want to make $variable global, then you place "global variable" ont he line below the proc line.
second, yes, it will show an error if the variable has never been set.
One way around this, is to do "set variable {}" at the beginign of the script. This will creat an instance of the variable, so the error won't occur.
Other methods include using "[info exists variable]" to test if it exists.