[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ns] syntax for 'for loop'



How about nested loops?  Such as:

set j 1
for {set i 0} {$i < 5} {incr i} {
    $ns at $j "$cbr($i) start"
    incr j
}

Portnoi
----- Original Message -----
From: "Raj M Verma" <[email protected]>
To: "users ns" <[email protected]>
Sent: Thursday, 30 de August de 2001 12:44
Subject: [ns] syntax for 'for loop'


> I wana start some CBR traffics at a certain point of
> time then I can use the loop as follows.
>
> for {set i 0} {$i < 5} {incr i} {
>     $ns at 1.0 "$cbr($i) start"
> }
>
> so here all CBRs are gonna start at 1.0, but if I wana
> start them at diff points of time, like cbr(0) at 1.0,
> cbr(1) at 2.0 and so on, I shud use one more variable
> for incrementing the time. my prob is how and where
> shud I use the other variable. pls lemme know the
> syntax. thanx.
> Raj.
>
> __________________________________________________
> Do You Yahoo!?
> Get email alerts & NEW webcam video instant messaging with Yahoo!
Messenger
> http://im.yahoo.com
>
>
>