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

Re: [ns] Tcl error



tcl syntax is wierd. you MUST put the opening brace on the same line as
instproc.

On Sat, 27 Jan 2001, Bai David wrote:

> Hi,
>    I write a instproc in Node class by TCL and put it
> into the ns-mcast.tcl file. It can succeed compile.
> However, when I enter "ns" in command line, it goes
> mad and gives more 10,000 lines output. These lines
> all seems to be the TCL scripts in ~/tcl/lib or
> ~/tcl/mcast directory. The last 3 lines are
> 
> : wrong # args: should be {Node instproc name args
> body}
>     (Class instproc line 1)
>     invoked from within
> "Node instproc get-oifs {src grp}"
> 
> My Tcl procedure is
> 
> Node instproc get-oifs {src grp}
> {
>         $self instvar ns_
>         set iiflist ""
>         set reps [$self getReps $src $grp]
>         foreach r $reps {
>                 set srcoifs [$r dump-oifs]
>                 foreach oif $srcoifs {
>                         set outlink [$self oif2link
> $oif]
>                         set inlink [$ns_ link [$oulink
> dst] $self]
>                         set iif [$self link2iif
> $inlink]
>                         lappend iiflist $iif
>                 }
>         }
> 
>         return [lsort $iiflist]
> }
> 
> 
> What's wrong with my programe? Could someone tell me
> how to add TCL program to NS code and debugging them?
> 
>     Thanks very much!
> 
> David
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - Buy the things you want at great prices. 
> http://auctions.yahoo.com/
> 
>