Re: Snit Problem- Invalid command name



At Fri, 30 May 2008 01:49:01 -0700 (PDT) Pradeep <bubunia2000ster@xxxxxxxxx> wrote:


On May 30, 12:56 pm, Aric Bills <aric.bi...@xxxxxxxxx> wrote:
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

Hi Aric,
Thanks for the quick reply.After I type ::dog in below I want to
return to % prompt.I tried pressing Enter/Return/Esc it did not
work.Could you please let me know the same?


% package require snit
1.0
% snit::type dog {
method speak {} {
return "$self barks"
}
::dog

Your braces don't balance. Type this in:

snit::type dog {
method speak {} {
return "$self bark"
}
}




--
Robert Heller -- Get the Deepwoods Software FireFox Toolbar!
Deepwoods Software -- Linux Installation and Administration
http://www.deepsoft.com/ -- Web Hosting, with CGI and Database
heller@xxxxxxxxxxxx -- Contract Programming: C/C++, Tcl/Tk

.


Quantcast