Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

calling procedures

0 views
Skip to first unread message

Chris Hare

unread,
Nov 10, 1992, 10:25:27 AM11/10/92
to

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?

Thanks!

--
???? --- It Always works for me! ---
Chris Hare, UNIX Scientist Preferred : ch...@unilabs.org
Just a mild-mannered consultant by day ....

Gerald W. Lester

unread,
Nov 10, 1992, 1:41:57 PM11/10/92
to
In article <1992Nov10.1...@unilabs.uucp>, ch...@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.

0 new messages