[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ns] A confused problem about tcl syntax
> I think you are not familiar with tcl...
> array is different from variable passing through proc.
> i think you should write " upvar $vegas v" instead of
> "global vegas" and then use v in proc...
I'll admit I'm no TCL guru but the use of global is ok here; he didn't actually
include his record procedure code so I assumed he meant it to take no parameters
like it does in the tutorials.
I agree it's probably better to pass it in as a parameter and use upvar to get
at the reference, but if he doesn't then using the global syntax is the only way
to get at his vegas array. Also, 'global' should be fine for both arrays and
simple values- it's always is a by-reference operation and alters those
variables (If it doesn't, then what's the point?).
If I'm wrong, let me know- because I've written a bunch of code this way ;)
-Eric
--------------------------------------------
Eric H. Weigle CCS-1, RADIANT team
[email protected] Los Alamos National Lab
(505) 665-4937 http://home.lanl.gov/ehw/
--------------------------------------------