Topic
  • No replies
SystemAdmin
SystemAdmin
232 Posts

Pinned topic problems in TCL Expect Script - For condition

‏2008-04-19T21:42:39Z |
hello i am building an topology of a network and have a condition down there:

code is :

set hilf1 expr (($l*$k*$m)%2)
if {$distri == 2} {

if {$hifl1 == 0} {

for {set i 0} {$i < $N_P} {incr i} {

$ns simplex-link $peer($i) $n(expr ($i%2)*($l*$k*$m/2)) 0.5Mb 10ms SFQ
$ns simplex-link $n(expr ($i%2)*($l*$k*$m/2)) $peer($i) 3Mb 10ms SFQ
#} else {

#for {set j 0} {$i < $N_P} {incr j} {

# $ns simplex-link $peer($j) $n(expr ($j%2)*(($l*$k*$m+1)/2)) 0.5Mb 10ms SFQ
#$ns simplex-link $n(expr ($j%2)*(($l*$k*$m+1)/2)) $peer($j) 3Mb 10ms SFQ

#}
#}
}

}

and i always got the same answer:
wrong # args: should be "for start test next command"
while compiling
"for {set i 0} {$i < $N_P} {incr i} {

$ns simplex-link $peer($i) $n(expr ($i%2)*($l*$k*$m/2)) 0.5Mb 10ms SFQ
$ns simplex-..."
("if" then script line 3)
while compiling
"if {$hifl1 == 0} {

for {set i 0} {$i < $N_P} {incr i} {

$ns simplex-link $peer($i) $n([expr ($i%2)*($l..."
invoked from within
"if {$distri == 2} {

if {$hifl1 == 0} {

for {set i 0} {$i < $N_P} {incr i} {

..."

i tried eleminating free space or put em between, maybe the problem is the two conditions above with the ifs?

thanks a lot for helping me, coffee is going out :).