[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ns] can't access $now
On Mon, 10 Apr 2000, Ishan Mandrekar wrote:
> ns-users:
>
> I get a compile error when I try to execute this command:
> $ns at [expr $now+$interval] "check"
>
> the error is:
> ns: check: can't read "now": no such variable
>
> I've seen $now being used in other scripts to get the current simulation
> time. What could be the problem here?
>
> The procedure definition of "check" goes as follows:
> proc check { } {
>
> global ns n3 n4 qlimit
You're missing:
#Get the current time
set now [$ns now]
L.
> ....
> ...
> ..
> .
> $ns at [expr $now+$interval] "check"
> }
<[email protected]>PGP<http://www.ee.surrey.ac.uk/Personal/L.Wood/>