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

Global variables in scripts??

0 views
Skip to first unread message

Hume C.L. Smith

unread,
Mar 28, 1995, 10:46:23 AM3/28/95
to
>>>>> "TS" == Troy Smith <td-s...@sal.cs.uiuc.edu> writes:

TS> How can you make a variable global in a script, so that every proc can
TS> see that variable? This is what I have...

TS> global Title

TS> proc proc1 {} {
TS> set Title bob
TS> }

it has to be the other way around. put global in the procedure. each
procedure has access to all global variables... it just has to ask
nicely.
--
Hume Smith hcls...@ra.isisnet.com
Waiting for a GNU version of JW's A! code. I have too much hacker ethic.
"What are you doing?" "I'm spelunking."
"There's a medicine you can take for that." Buster & Babs

Troy Smith

unread,
Mar 28, 1995, 10:30:05 AM3/28/95
to
How can you make a variable global in a script, so that every proc can
see that variable? This is what I have...

global Title

proc proc1 {} {
set Title bob
}

I get a Title undefined error when I try and run the script? Any
suggestions?

Thanks,
Troy

Michael Salmon

unread,
Mar 30, 1995, 1:16:41 AM3/30/95
to
In article <3l9a1t$6...@vixen.cso.uiuc.edu>

In Tcl you need to define global variables in the procedures that
access them, global declarations at the global level are tautologies.

--

Michael Salmon

#include <standard.disclaimer>
#include <witty.saying>
#include <fancy.pseudo.graphics>

Ericsson Telecom AB
Stockholm

0 new messages