Hello,
I have the following problem regarding TCL variable substitution
I have the following code in ns2:
set Appl_udp_0_1 [new Agent/UDP]
$ns attach-agent $n(0) $Appl_udp_0_1
$Appl_udp_0_1 set class_ 1
where the first number in $Appl_udp_0_1 (i.e 0) characterizes the node the UDP agent is running and the second number (ie. 1) the flow id.
In a procedure i have the following parameters
proc test { src flowid} {
global Appl_udp_$src_$flowid
}
My problem is that TCL takes as variable the $src_ (including the "_" character) and as a result shows that a variable $src_ does not exist.
Is there a way i can make the variable expression to stop before the "_" character ??
Thank you.
I have the following problem regarding TCL variable substitution
I have the following code in ns2:
set Appl_udp_0_1 [new Agent/UDP]
$ns attach-agent $n(0) $Appl_udp_0_1
$Appl_udp_0_1 set class_ 1
where the first number in $Appl_udp_0_1 (i.e 0) characterizes the node the UDP agent is running and the second number (ie. 1) the flow id.
In a procedure i have the following parameters
proc test { src flowid} {
global Appl_udp_$src_$flowid
}
My problem is that TCL takes as variable the $src_ (including the "_" character) and as a result shows that a variable $src_ does not exist.
Is there a way i can make the variable expression to stop before the "_" character ??
Thank you.