home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.tcl
- Path: sparky!uunet!think.com!spool.mu.edu!tulane!cpu.com!cpu.com!GWLESTER
- From: gwlester@cpu.com (Gerald W. Lester)
- Subject: Re: calling procedures
- Nntp-Posting-Host: captainhook.cpu.com
- References: <1992Nov10.152527.27992@unilabs.uucp>
- Sender: usenet@cpu.com (Usenet administrator)
- Organization: Computerized Processes Unlimited, Metairie, LA, (504)-889-2784
- Date: Tue, 10 Nov 1992 18:41:57 GMT
- Message-ID: <1992Nov10.184157.10279@cpu.com>
- Reply-To: gwlester@cpu.com
- Lines: 31
-
- In article <1992Nov10.152527.27992@unilabs.uucp>, chare@unilabs.uucp (Chris Hare) writes:
- >
- >I have a procedure called errorDialog defined near the bottom of my wish
- >script :
- >
- >proc errorDialog { $message } {
- >....
- >}
- >
- >Near the top of my script I will call this procedure if there isn't some
- >stuff setup.
- >
- >if { ... } {
- > errorDialog $stuff
- >}
- >
- >I get told by wish that the procedure errorDialog is unknown. What am I
- >missing?
-
- Tcl executes the file as it reads it in. It does *NOT* make a pass
- over the file to check syntax and define all procedures, hence your procedure
- is not defined when you try to call it. I find that structuring TCL files like
- Pascal programs (i.e. the main at the end) works great.
-
- >
- >Thanks!
- >
- >--
- >???? --- It Always works for me! ---
- >Chris Hare, UNIX Scientist Preferred : chare@unilabs.org
- >Just a mild-mannered consultant by day ....
-