f



Hello

Hi:
   I am a new user in tcl. When I use itcl to program a class,and i
have added the  file of tclIndex. I run it ,the tcl interpretor tell
me  a invalid command "class" . But I cannt understand the reason. For
example
File myclass.tcl:
class MyClass {
 public {
constructor {} {}
destructor {} {}
  }
}
File tclIndex:
....

File my.tcl:
lappend auto_path {e:\program\}
package require itcl 
package require itk

MyClass b


when run it ,the interpretor show an invalid command "class"
0
11/27/2003 10:54:28 AM
comp.lang.tcl 23429 articles. 2 followers. Post Follow

2 Replies
595 Views

Similar Articles

[PageSpeed] 56

guan.shangyuan51@zte.com.cn (guan sy) wrote in message news:<8d6b5244.0311270254.30276c04@posting.google.com>...
> Hi:
>    I am a new user in tcl. When I use itcl to program a class,and i
> have added the  file of tclIndex. I run it ,the tcl interpretor tell
> me  a invalid command "class" . But I cannt understand the reason. For
> example
> File myclass.tcl:
> class MyClass {
>  public {
> constructor {} {}
> destructor {} {}
>   }
> }
> File tclIndex:
> ...
> 
> File my.tcl:
> lappend auto_path {e:\program\}
> package require itcl 
> package require itk
> 
> MyClass b
> 
> 
> when run it ,the interpretor show an invalid command "class"

just help you to set your question to the top! :)
0
yubing_jin
11/28/2003 1:14:56 AM
Incr Tcl keeps its commands neatly tucked away in its very own 
namespace. So there are two things that can be done:
1. use the namespace qualified version of the command
    ::itcl::class MyClass {
       ...

2. import Incr Tcl's exported commands, like "class", "scope", "code", 
"find", ect.
    namespace import ::itcl::*
    class MyClass {
       ...


Oh, I don't know if this is just a example quicky thing, but your 
"destructor" will generate a "invalid argument" error. Should be like this:
   destructor {
      # no arguments are allowed!
      # do some object destruction clean up!
      ...
   }

-- bryan






guan sy wrote:
> Hi:
>    I am a new user in tcl. When I use itcl to program a class,and i
> have added the  file of tclIndex. I run it ,the tcl interpretor tell
> me  a invalid command "class" . But I cannt understand the reason. For
> example
> File myclass.tcl:
> class MyClass {
>  public {
> constructor {} {}
> destructor {} {}
>   }
> }
> File tclIndex:
> ....
> 
> File my.tcl:
> lappend auto_path {e:\program\}
> package require itcl 
> package require itk
> 
> MyClass b
> 
> 
> when run it ,the interpretor show an invalid command "class"

0
bschofield (23)
11/28/2003 5:59:37 AM
Reply:

Similar Artilces:

hello hello hello
Is anybody in there? Just nod if you can hear me. Is there anyone at home? -- -- Ben Thomas - Software Engineer - Melbourne, Australia This message and any attachments is/are intended for the person/s to whom it was addressed. It may contain privileged or confidential information. If you have received this message in error, please notify the sender promptly and destroy the message without copying it or divulging its contents to any person. Opinions, conclusions, and other information in this message that do not relate to the official business of my firm shall be understood as neither given nor endorsed by it. On Tue, 15 Jun 2004 04:10:09 GMT, BenOne� <nosp@m.thanks.mate> found these unused words floating about: >Is anybody in there? >Just nod if you can hear me. >Is there anyone at home? >-- Contact your ISP ... you obviously have a problem if you can't see the messages and replies (24 alone today - other than yours, that is!) ...

Hello Moto...hello?...hello?
Hope this isn't OT but I'm looking for help with syncing a Motorola V3 RAZR bluetooth cell phone with my 10.3.8 Mac - and although it is advertised as Mac-compatible, the Phone Tools CD that came with it is Windows-only. Does anyone know if I can still use iSync with this 'phone to sync contacts? I'm assuming that I can anyway connect it via USB and drag stuff in manually but it would be a bit of a let-down if I can't sync automatically. I spoke to Motorola and they said that Apple knew of a way to make their Phone Tools software install under OsX. But the Apple bod I spo...

tcl-gaul: Genetic Algorithms for Tcl. (Tcl package)
This is an announcement for a relatively new Tcl project: tcl-gaul Tcl-gaul is a Tcl extension for genetic/evolutionary algorithm processing.It relies on the GAUL library: http://gaul.sourceforge.net/ * A genetic algorithm (GA) is a search technique used in computing to find exact or approximate solutions to optimization and search problems. Genetic algorithms are categorized as global search heuristics. They are a particular class of evolutionary algorithms that use techniques inspired by evolutionary biology such as inheritance, mutation, selection, and crossover. For an introduction to genetic algorithms visit: http://gaul.sourceforge.net/intro.html Platform: Linux (GAUL library dependency) Home page: http://sourceforge.net/projects/tcl-gaul/ Man page: http://tcl-gaul.sourceforge.net/ Author: Alexandros Stergiakis alsterg ...

tcl-pam: PAM authentication for Tcl (Tcl package)
This is an announcement for a relatively new Tcl project: tcl-pam Tcl-pam is a Tcl interface to the PAM* service of Linux. It provides a Tcl package that allows Tcl scripts to use PAM to authenticate users and programs. It relies on linux-pam library: http://www.kernel.org/pub/linux/libs/pam/ * PAM (Pluggable Authentication Modules): A mechanism to integrate multiple low−level authentication schemes into a high−level application programming interface (API). This enables programs that rely on authentication to be written independently of the underlying authentication scheme. Platform: Linux Home page: http://sourceforge.net/projects/tcl-pam/ Man page: http://tcl-pam.sourceforge.net/ Author: Alexandros Stergiakis alsterg ...

tcl-mmap: A POSIX mmap interface for Tcl. (Tcl package)
This is an announcement for a relatively new Tcl project: tcl-mmap Tcl-mmap is a Tcl interface to the POSIX mmap* system call. It provides a Tcl package that allows Tcl scripts to: 1) Memory map files for improved access efficiency; 2) Share memory between related processes; 3) Easily implement cyclic persistent log files. * See the mmap(2) man page. Platform: Linux/Unix Home page: http://sourceforge.net/projects/tcl-mmap/ Man page: http://tcl-mmap.sourceforge.net/ Author: Alexandros Stergiakis On Sep 3, 11:48=A0am, Alexandros Stergiakis <alst...@gmail.com> wrote: > This is an announcement for a relatively new Tcl project: tcl-mmap > > Tcl-mmap is a Tcl interface to the POSIX mmap* system call. It provides > a Tcl package that allows Tcl scripts to: 1) Memory map files for > improved access efficiency; 2) Share memory between related processes; > 3) Easily implement cyclic persistent log files. > > * See the mmap(2) man page. > Great to see this and the other packages you made. Looking at the manpage it looks a bit misformatted before the usage example. Any specific reason to use GPL for this instead the usual Tcl/MIT/BSD style license used? Michael schlenk wrote: > On Sep 3, 11:48 am, Alexandros Stergiakis <alst...@gmail.com> wrote: >> This is an announcement for a relatively new Tcl project: tcl-mmap >> >> Tcl-mmap is a Tcl interface to the POSIX mmap* system call. It provides >> a Tcl package that...

tcl-syslog: Unix system logging for Tcl (Tcl package)
This is an announcement for a relatively new Tcl project: tcl-syslog Tcl-syslog is a Tcl interface to the *nix syslog service. It provides a Tcl package that allows Tcl scripts to log messages to syslog. Platform: Linux/Unix Home page: http://sourceforge.net/projects/tcl-syslog/ Man page: http://tcl-syslog.sourceforge.net/ Author: Alexandros Stergiakis alsterg ...

tcl-mq: POSIX Message Queues for Tcl. (Tcl package)
This is an announcement for a relatively new Tcl project: tcl-mp Tcl-mp is a Tcl interface to POSIX Message Queues*. It provides a Tcl package that allows scripts to create/open/close/unlink multiple parallel message queues, and to send/receive messages synchronously and asynchronously to/from them. * A POSIX message queue is an Inter-Process Communication mechanism available on Linux and some other POSIX-compliant operating systems. It allows to or more processes (or threads) to communicate under the same OS. The messages are buffered by the kernel, which gives them kernel persistency. A message queue can be thought of as a linked list of messages. Threads with adequate permission can put messages onto the queue, and threads with adequuate permission can remove messages from the queue. Each message is assigned a priority by the sender, and the oldest message of highest priority is always retrieved first. Unlike PIPES and FIFOS, no requirement exists that someone be waiting for a message to arrive on a queue, before some process writes a message to that queue. It's not even a requirement for both processes to exist at the same time. Read mq_overview(7) for more details Platform: Linux Home page: http://sourceforge.net/projects/tcl-mp/ Man page: http://tcl-mp.sourceforge.net/ Author: Alexandros Stergiakis alsterg On Sep 3, 11:37=A0am, Alexandros Stergiakis <alst...@gmail.com> wrote: > This is an announcement for a relatively new Tcl pro...

Hello World program for tcl using xlib
Hi, I just started learning tcl and xlib, I got Hello World program working for tcl as well as xlib seperatly **tcl** http://wiki.tcl.tk/300 #! /usr/bin/tcl puts "hello, world" **xlib and c** http://en.literateprograms.org/Hello_World_(C,_Xlib) But I want to use xlib in tcl, I searched on internet but I couldn't find Hello World program for tcl and xlib. Any help is appreciated. If anyone knows some articles, tutorials, websites or books regarding tcl and xlib please let me know. Thanks. Hrishikesh Hrishikesh wrote: > But I want to use xlib in tcl, I searched on internet but I couldn't > find Hello World program for tcl and xlib. Any help is appreciated. The easiest way is to use the Tk toolkit to help. (Add a suitable #! line if you want.) package require Tk button .b -text "Hello world!" -command {exit} pack .b That will use xlib on platforms where it is appropriate to do so. Of course, that code's rather more complex than the classic Tcl "hello world" example. But then again, GUI's *are* more complex than simple non-interactive scripts. Can't make it shorter without making it even more confusing... Donal (to understand the code, take that code and try changing bits of it.) On Dec 31, 8:06 am, Hrishikesh <hrishi....@gmail.com> wrote: > Hi, > > I just started learning tcl and xlib, > > I got Hello World program working for tcl as well as xlib seperatly > > **tcl**http://w...

Opening a TCL program from within another TCL program in ANSYS Tcl-Tk
Hi everyone, I have been pulling my hair with this one for a couple of days and still have not found a fix. I'm working within ANSYS Tcl-Tk implementation. I created a Tcl-Tk script that generates a simple window with three buttons. Each button opens another window which is created in a separate Tcl file. The second window have a lot of text entries, variables, procedures, etc. I can open the second Tcl file by itself and everything works as supposed, but when I open it using the button in the first window, it opens but any procedure called by the widgets on the second window are not found... Here's the deal... Since I'm working within the ANSYS implementation of Tcl-Tk, I'm actually using an ANSYS command to open the second window. The command I use is: ### ans_sendcommand ~eui,'source O:/mad_projects_2/ANSYS/Macros/ IBR_CAS.tcl' ### It actually sends a command back to ANSYS telling it to execute a Tcl command... I know this is not pretty but its the only way i was able to make it at least show the window. ############################## #Main Tcl (excerpt): ############################## namespace eval Tools { proc IBRCambpell {} { #source O:/mad_projects_2/ANSYS/Macros/IBR_CAS.tcl ans_sendcommand ~eui,'source O:/mad_projects_2/ANSYS/Macros/ IBR_CAS.tcl' } proc viewManager {} { ans_sendcommand ~eui,'source O:/mad_projects_2/ANSYS/Macros/ ViewManager.tcl' } proc powerAnnotation {} { ans_sendcommand ~eui,'source ...

tcl-snmptools: SNMP v1/v2/v3 operations for Tcl. (Tcl package)
This is an announcement for a relatively new Tcl project: tcl-snmptools Tcl-snmptools is a Tcl interface to the Net-SNMP library which provides operations for the management of remote SNMP agents. It supports all the standard SNMP v1/v2/v3 operations: connect, close, get, set, getnext, walk, bulkget, bulkwalk, trap, translate and others. It is currently in a functional state, but more work and testing needs to be done. Home page: http://sourceforge.net/projects/tcl-snmptols/ Man page: http://tcl-snmptols.sourceforge.net/ Author: Alexandros Stergiakis alsterg ...

tcl application with tcl application
Here is another question, I have one tcl-based application A, my co- worker has a tcl-based application B. Now I want to integrate my application A into the application B. After integration, I want to be able to run A's tcl command in B. Assume I can only change A's code, is there any way to do this? On 17 Dez., 07:03, teacupfull business <teacupfull.busin...@gmail.com> wrote: > Here is another question, I have one tcl-based application A, my co- > worker has a tcl-based application B. Now I want to integrate my > application A into the application B. >...

How to compile tcl or encrypt tcl
I use TclPro1.5 to compile my tcl script with tixwish in the Solaris before. But I cannot use the same method in Linux. Why? Is there any utility for me to compile or encrypt the code by using tixwish? The following is the simple code if I use the tixwish: #!/home/albertl/local/bin/tixwish puts "haha" And after using procomp by the TclPro1.5 Error in startup script: The TclPro ByteCode Loader is not available or does not support the correct version while executing "error "The TclPro ByteCode Loader is not available or does not support the correct version"" invoked from within "if {[catch {package require tbcload 1.3} err] == 1} { error "The TclPro ByteCode Loader is not available or does not support the correct version" ...." (file "a.tbc" line 4) The problem seems that tbcload1.3 cannot be found? But tbcload is already there "/home/albertl/local/lib/tbcload1.3" Why? Can anyone tell me? stratus schrieb: > I use TclPro1.5 to compile my tcl script with tixwish in the Solaris before. > But I cannot use the same method in Linux. Why? > > Is there any utility for me to compile or encrypt the code by using tixwish? > Tixwish is just a wish shell with the Tix package baked in. If TclPro does not have a specific bigwish with Tix included your out of luck on that road (but could build your own if you liked). You might have success with freewrap or TDK, don't know for su...

How Tcl speaks for itself and how Tcl is not spoken for...
Hello It's Friday and... well... Two things about Tcl going through my mind this week, a nice anecdote and a eyebrow-rising thing on Wikipedia: Anecdote: Until three months ago I worked in a scientific institue where I wrote much software in Tcl, especially a big Build and Report System, some tools for automatic checking of coding style and other things. Tcl had a bad reputation there (not because of me... they dropped Tcl before I started there in favour of Joy, then JavaScript and now Python) and besides me, there was only one co-worker who appearantly writes some small Tcl-Scripts to support other researchers in their work. To get completely rid of Tcl, they even started to reimplement all things, I wrote in Tcl in Python just to have it in a language, that most of them know (which is a good decision on the one hand, but on the other hand, I think, it would be better to simply learn Tcl ;-), which made me a little bit sad. Now there is a new collegue who has to maintain some of the things I wrote. Comming from Perl he wasn't exactly enthusiastic when he heard, that he must maintain my old code in such an obscure language.. Two weeks ago, I got mail from him. He's just studying a complex system of scripts that are used for a sandboxed build system for source code which comes from external untrusted source and must be compiled and tested. Of course it's written in Tcl (and some bash-Scripting). He told me, that although he has never looked at Tcl before,...

Why xml:lang instead of lang?
What was the reason to introduce a new attribute "xml:lang" instead of "lang"? This bothers both authors and browsers in different language versions: HTML 4, XHTML 1.0, XHTML 1.1. HTML has only "lang"; XHTML 1.1 has only "xml:lang"; XHTML 1.0 has both! For example, Mozilla 1.7 recognizes the lang attribute http://www.unics.uni-hannover.de/nhtcapri/temp/lang-attribute.htm but it does not recognize the xml:lang attribute. http://www.unics.uni-hannover.de/nhtcapri/temp/lang-attribute.xhtml What do we gain from "xml:lang"? Andreas Prilop wrote: > What was the reason to introduce a new attribute "xml:lang" > instead of "lang"? > What do we gain from "xml:lang"? By putting the attribute in the general and predefined namespace http://www.w3.org/XML/1998/namespace it can be used by any XML application (e.g. XHTML, SVG) without any further effort and without any danger of colliding with attributes in no namespace a particular XML application might want to define. -- Martin Honnen http://JavaScript.FAQTs.com/ Andreas Prilop wrote: > What was the reason to introduce a new attribute "xml:lang" > instead of "lang"? Since it is useful to have a means of describing language in the core of XML. It only looks silly from an (X)HTML-centric viewpoint. -- David Dorward http://dorward.me.uk/ In article <Pine.GSO.4.44.0603311415390.8640-100000@s5b004.rrzn.u...

Extending TCL in C with tcl.h - Disabliing [<tcl-cmd>] feature
Hi, TCL has a command execution syntax like this: [<tcl cmd>] Anything inside the 3rd bracket will be executed as a Tcl command by the Tcl interprater. Is there any way I can disable/delete this Tcl construct [ <tcl-cmd>]? In other words, my Tcl interprator should print "[32]" for tcl command puts "[32]" It should not try to treat [] as a special character. Is this any way possible while extending Tcl in C with tcl.h? Thank you, Arijit * arijit79@gmail.com | puts "[32]" | | It should not try to treat [] as a special character. Check out the TCL quoting rules. http://www.tcl.tk/man/tcl8.4/TclCmd/Tcl.htm http://www.tcl.tk/man/tcl8.4/TclCmd/Tcl.htm#M10 http://www.tcl.tk/man/tcl8.4/TclCmd/Tcl.htm#M15 Any of puts {[32]} puts "\[32\]" will do the trick. R' On May 8, 3:14 am, ariji...@gmail.com wrote: > Is there any way I can disable/delete this Tcl construct [ <tcl-cmd>]? By doing this, you would disable the primary functionality of Tcl. I'm certain you could go into the tcl source and stop it - but why not talk about what you are really trying to do. Perhaps someone can give you a better way of doing what you are wanting to do. ...

why did Don Libes choose TCL as underground lang of Expect rather than Perl?
Hello Tclers, I think maybe this question could be answered by Don himself. But looks like he didnt show up in c.l.t for years. I checked wiki then found Appeared in 1987 Perl Appeared in 1988 TCL Why did he pick TCL rather than Perl? On 13 sep, 11:27, jn...@lycos.com wrote: > Hello Tclers, > I think maybe this question could be answered by Don himself. > But looks like he didnt show up in c.l.t for years. > I checked wiki then found > > Appeared in 1987 Perl > Appeared in 1988 TCL > > Why did he pick TCL rather than Perl? I remember to have read from Don in c.l.t. not that long ago... Perhaps my question would be different... How come that the first version of expect was done in Perl? jima wrote: > On 13 sep, 11:27, jn...@lycos.com wrote: > >>Hello Tclers, >>I think maybe this question could be answered by Don himself. >>But looks like he didnt show up in c.l.t for years. >>I checked wiki then found >> >>Appeared in 1987 Perl >>Appeared in 1988 TCL >> >>Why did he pick TCL rather than Perl? > > > I remember to have read from Don in c.l.t. not that long ago... > > Perhaps my question would be different... > > How come that the first version of expect was done in Perl? http://expect.nist.gov/HISTORY go to the end of the page: 1/25/90 Attended Winter 1990 USENIX in DC, with the goal of banging heads with some other gurus in hopes of finding a good send...

hello
hi ...

hello
test ...

hello
hi guys!!! im new here and im from the philippines. im in the middle of learning web design. i hope some of you guys can visit my web site http://www.ienterprise.bravehost.com and maybe can share some ideas whats lacking on my site? thanks people!!. ...

hello
hello,guys.which algorithm can classfy datas?Dose the scilab have that toolbox? Please help me ,thanks hello to you. a quick google turned up this scilab contribution on support vector machine (SVM) toolbox: http://scilabsoft.inria.fr/contrib/displayContribution.php?fileID=185 there is a nice graphical description of the SVM concept here: http://www.dtreg.com/svm.htm i'm sure there is more classification information out there. if you have a particular problem, you may have to roll your own. however that SVM toolbox looks like a good place to start. hope it helps. ...

hello
hello ...

Web resources about - Hello - comp.lang.tcl

Bernie Sanders: Donald Trump Is A Liar, Encourages Violence
On Sunday morning, Bernie Sanders appeared on CNN’s “State of the Union” with Jake Tapper. During the 11-minute segment, Tapper interviewed Sanders ...

Billie Lourd Will Return With A Larger Role In ‘Star Wars Episode 8’
Billie Lourd was on the red carpet for Fox’s Scream Queens at Paleyfest on Saturday night. We’ll have a full story on Scream Queens later but ...

World T20: Aussie star Josh Hazlewood takes hat-trick in warm-up match against West Indies - DailyTelegraph ...
JOSH Hazlewood appears resigned to the likelihood he will miss the cut for Australia’s World Twenty20 attack, despite delivering with a timely ...

Multiple doctors gave Germanwings co-pilot sick leave certificates before crash
Los Angeles Times Multiple doctors gave Germanwings co-pilot sick leave certificates before crash Los Angeles Times PARIS – Germanwings co-pilot ...

Divers Pull Body of 2nd Tugboat Crew Member From Hudson River; 3rd Man in Tugboat Crash Still Missing ...
Divers pull body of 2nd tugboat crew member from Hudson River; 3rd man in tugboat crash still missing

Watch: ‘Alice Through the Looking Glass’ TV Spot Questions Daylight Saving Time
Was an extra hour stolen this morning? That’s what the new TV spot for Disney’s “Alice Through the Looking Glass” asks after Sunday’s Daylight ...

Gunmen scream 'Allah Akbar' as they gun down 14 people at Ivory Coast beach resort popular with Westerners ...
Four gunmen armed with machine-guns and hand grenades have gone on the rampage at a popular hotel in Ivory Coast, leaving at least 12 people ...

Every Quarter Of This Insane Ohio High School Basketball Final Ended On A Buzzer-Beater
Garfield Heights took down St. Ignatius last night in some hot Cleveland Regional Final action to head to the state semifinals. The Bulldogs ...

Officials say unrest at prison in Alabama leaves 2 hurt
Inmates set a fire, seized control of a dormitory and stabbed two corrections officials during a violent uprising at a prison in southern Alabama, ...

Kanye West says Justin Bieber hit was his "favorite song of 2015"
Kanye West — beloved by teen girls, teen boys, and multimillionaire hip-hop moguls. West has been relatively silent on Twitter for, say, the ...

Resources last updated: 3/13/2016 8:17:46 PM