comp.lang.tcl
[Top] [All Lists]

Re: Snit Problem- Invalid command name

Subject: Re: Snit Problem- Invalid command name
From: Aric Bills
Date: Fri, 30 May 2008 00:56:34 -0700 PDT
Newsgroups: comp.lang.tcl

On May 29, 10:12 pm, Pradeep <bubunia2000s...@xxxxxxxxx> wrote:
> Hi all,
> I have installed snit1.0 and copy the same in C:\Program Files.I tried
> to run a simple program as below. I have created a snit type dog.
> After the ::dog as below how will I return to the %prompt to  execute
> it? More ever I am getting a problem
> "Invalid comand name snit::type". Could anybody help me in this
> regard?
>
> Thanks in advance
> Pradeep
>
> % snit::type dog {
> snit::type dog {
> method speak {} {
>
> return "$self barks"}
>
> ::dog

Hi Pradeep,

You need to do "package require snit" before you start using snit
commands.  For Tcl to find snit, the snit files need to be in a
directory Tcl knows about.  The variable $auto_path contains the
directories Tcl knows to search for packages; you can move snit into
one of these directories, or you can use [lappend auto_path {C:/
Program Files}] if that's really where you want snit to live.

Hope that gives you something to go on.

Regards,
Aric

<Prev in Thread] Current Thread [Next in Thread>
Privacy Policy