Stewart Allen wrote:

> > > I create an app with vtcl that reads in variables from an external file
> > > and save it, all my read-in variables are saved in the source as global
> > > varibles. Is there a way to defeat this?

>  Visual Tcl "opens" files by sourcing them. It does a couple of tricks
>  to "learn" of new variables and procedures by comparing before and after
>  the source. Saving is done by walking the widget tree, stored procedures
>  and special gui procedures from closed windows. It is consistent given
>  this process that you see the above variable behaviour.

>  since tcl interprets as it sources files. there are a couple of ways of
>  avoiding this substitution, but it requires new options in visual tcl
>  (which I will add) which would be vastly confusing to those not very
>  familiar with tcl's interpreted nature (and this not defaults).

Hmmm. Does this mean that the "autoload" library feature, which really
just sources tcl files, will also have the loaded variables _and_
procedures
saved by vTcl? I hadn't thought of that scenario. I can see where that
would be undesirable.

I'm not sure if I understand your suggested solution.
Do I read right that there will be a config preference to "not save
variables
or procs from sourced files"?

This issue goes a step further. I think a few of us are suggesting a
preference
that says: "Just save the global 'widget' array of aliases, but no other
globals".
To me this makes sense. Since all globals are defined in the procs in
the app
in the first place, vTcl doesn't need to generate code to explicitly
define and set them in the saved application. 

-- 
...RickM...

Reply via email to