On Mon, 24 Mar 1997, Rick Macdonald 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?

> 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. 

This was causing me enough grief that I had a look at the vTcl source.

It took less than a minute to find and make the following change in
"dump.tcl":

proc vTcl:save_vars {} {
    global vTcl
    set output ""
#    set list $vTcl(vars)
#    vTcl:list add widget list
    set list widget
...etc...

I commented out the two lines that build the variable list, and added the
one line to set list to "widget" so that only the aliases are saved.

WARNING: Since I'm new to vTcl, and have only been using it with one
application so far, I can't say for sure if this will have undesired
side effects. 

I hope Stewart will make this all configurable in an upcoming release.
There's a lot more to it, given that some have suggested that they don't
wan't _anything_ from files that are sourced by an application to be
saved with the application.

...RickM...

Reply via email to