Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multiple use off variables

Status
Not open for further replies.

BiggerT

Programmer
Jan 20, 2004
10
0
0
NL
Hello I'm trying to use a variable , wich I've declared in "script a", in a procedure wich I'm sourcincing with the source command.

set uniek [clock seconds]

source "H:\\usr\\local\\Text invulvak klantnaam.tcl"
klantnaam
}

The problem is that I won't get the uniek variable to work in the klantnaam procedure!

Can somebody help me with this?
 
You need to declare the variable as "global", in both scripts, in all procs where it is used or declared or set.

Bob Rashkin
rrashkin@csc.com
 
Either that or use upvar.

proc klantnaam {varname {lvl "#0"}} {
upvar $lvl $varname local
#do something with $local
}

You can also check out the wiki, there are a few
articles on upvar and uplevel.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top