On Tue, 18 Feb 1997, Ross Johnson wrote:

> On Mon, 17 Feb 1997, Lownds, Tony wrote:
> 
> > I have a seperate tcl script with a bunch of procedures in it; if I 
> > source the tcl file in the init procedure, all of the code gets sucked 
> > into the vtcl-generated script. 
> > 
> > Is there a workaround? 
> > 
> 
> Try sourcing your file from within the init proc using uplevel. Eg:
> 
> uplevel source myinclude.tcl
> 

didn't help... the sourced file was all procedures, btw.

> I just tried a very quick test which appeared to work ok.
> 

I figured out some more exact steps to reproduce this:

-run vtcl  
-edit the init procedure, adding: source some_tcl_file.tcl
-save as... new.tcl
-close
-open new.tcl
-refresh the functions window
-the procedures in some_tcl_file.tcl should now be listed in the functions 
window
-save 
-the procedures in some_tcl_file.tcl are now included in new.tcl

I have also found that, in vt 1.07 at least, that if the init procedure 
has an error then the toplevels and other procedures disappear when you 
save, close and open the file as above. 

I haven't looked in depth, but it seems like making init and/or main
"smarter" would help here. ie, the generated code could check if vtcl is
running, and if so, delay execution until after the results of the load
are compiled. Its easy to check if vtcl is running, but I don't know how
to delay the execution until the right moment without mucking with vtcl 
(and maybe not even then).

Another problem:

when editing a procedure, if I add an argument with a default of {}, hit 
ok then edit that procedure again, the {} is gone, but the surrounding 
braces are still there. If I hit ok and edit again the surrounding braces 
are gone.

initially: {text {}}
1st time: {text }
2nd time: text

Same kind of thing happens for a default like "kjsgdf kdgf sd"

-Tony Lownds

Reply via email to