[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...

It must work....
Good Luck

Xiangjing Chen

On Thu, 2 Nov 2000, Eric Weigle wrote:

>>     I have one weird problem about using tcl. At first, I have set up Vegas
>> connections successfully. While I add a procedure "record" like the following,
>> it can't be executed for "vegas($i)" not found. Is it not allowable to add
>> brackets in the proc or do I use the wrong way?
>The code you attached looked ok to me, in your record function are you using
>$vegas($i) and remembering to declare it global like:
>
>proc record {} {
>	global vegas;
>
>	for {set i 1} {$i < $node_no} {incr i} {
>		puts "[$vegas($i) set nackpack_]"
>		...
>	}
>}
>
>?
>
>-Eric
>
>--------------------------------------------
> Eric H. Weigle   CCS-1, RADIANT team
> [email protected]     Los Alamos National Lab
> (505) 665-4937   http://home.lanl.gov/ehw/
>--------------------------------------------
>