From: salah j. <s_...@ya...> - 2006-03-31 07:04:52
|
Hi guys I faced a problem with sessions, so I invent a way to give the variables a unique name the global scope by using namespaces, inorder to maintain variable state , i do not know how much this way is good i am a fraid of it a little bit. did any body can explain me what are the draw back of this method. second in the session library how it is work to maintain variable states and can you give me example. set sess 12345 namespace eval [set sess] { } set [set sess]::x 5 put $x put [expr $[set sess]::x] puts [set ${sess}::x] proc delete_var { sess } { foreach var [info vars [set sess]::*] { unset $var } } if {[namespace exists $sess]} { error "duplicate sessionID: $sess" } Thanks in advance --------------------------------- Blab-away for as little as 1¢/min. Make PC-to-Phone Calls using Yahoo! Messenger with Voice. |