Hi,
 
I am using ns 2.33 on a solaris/intel machine. In the ns2 TCL script I want to 
use a variable defined in C++. The variable is used for looping control as 
follows:
 
while {$x < 16.0} {
        ...
        for {set y 1.0} {$y < $ns at $x "$sipalice getSize"} {set y [expr 
(0.5+$y)]} {
              ...
         }
         ...
}
 
The statement $ns at $x "$sipalice getSize" returns now some weird integerid. 
The command getSize is defined here:
...
} else if (!strcmp(argv[1], "getSize")){ 
 Tcl& tcl = Tcl::instance();
 sprintf(tcl.buffer(),"%d",SIPSingleton::getInstance()->getSize()); 
 tcl.result(tcl.buffer());
 return(TCL_OK);
}
...
I think the tcl.result is overwritten by the Scheduler::command(..) function...
Is it in in any way possible to return a variable to the tcl script when the 
scheduler is started? I know it is possible without timing (without the "$ns at 
x" part), but I have to use the timing otherwise statements are executed too 
early.
 
Regards,
 
Jo
_________________________________________________________________
Rediscover Hotmail®: Get e-mail storage that grows with you. 
http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Storage2_042009

Reply via email to