[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Question about tcl command 'set' in 'proc'
I have a problem with the following Tcl code.It's for NS-1.4,
and the interpreter gave a message,
" can't read "ssm:" no such variable "
proc sarmoa { command index layer node } {
if { $command == "set-sender" } {
set ssm$index [ns agent sarmoa_sender_manager $node]
set ssc [expr $index*100]
for { set i 0 } { $i < $layer } { incr i } {
set ss$ssc [ns agent sarmoa_sender $node]
$ssm$index layer-port $i [$ss$ssc port]
$ss$ssc manager-port [$ssm$index port]
incr ssc
}
}
}
But the set command ,
>> set ssm$index [ns agent sarmoa_sender_manager $node]
worked well in the ns prompt. It made me crazy when included in
the proc command.
I don't understand why the set command generates errors.
Any suggestion would be great help to me!
Thank you in advance.