On Sat, 22 Mar 1997, Laurent Duperval wrote:

> I found out today that when you create a variable as global, it is
> initialized when the script is saved. I would expect it to be declared
> as global but not initialized. I would expect control for the
> initialization of the global variables to be done in the init procedure.
> My global variables are initialized with the result of executing a
> command. Furthermore, some of those initializations require a specific
> global variable to be initialized beforehand. Since the variables are
> saved in alphabetical order, it causes problems because the most
> important variable is not save first.

 I've added a preference in 1.09 not to set global values (just define
 them as global) before init. I'm not sure how to preserve the order,
 but if you defer initialization of the variables to init, then you're
 in control.

> I've also found that the global variables are initilized to a real
> value, not a result. So even if I manually modify the generated script
> to get:
> 
> global foo; set foo [bar]
> 
> when I load and save with vtcl, the result is
> 
> global foo; set foo {foobar}
> 
> where {foobar} is whatever value was originally returned by bar.

 This is an artifact of "sourcing" a file. You should set these
 values inside of a procedure which you call.

 -stewart-

Reply via email to