Here's something that most of you vtcl veterans probably know, but might be
helpful to some of the newer recruits (like me).
In debugging a strangeness that was happening whenever I loaded a file into
vtcl I discovered that vtcl actually *runs* the init and main routines when
a file is loaded. Some experimentation revealed that init must execute
without error during this load time in order for vtcl to continue loading
the application, but it seems that it doesn't care if main runs correctly
or not.
Two of the "strangenesses" that caused me to investigate this:
1) I was trying to use a Win95 development platform to build a unix TCL app
that requires a shared library that only exists on our unix systems...
vtcl under Win95 would not load the application. Either moving the load
command for the shared library from init to main or adding a catch around
the load in init allowed me to edit it under Win95.
2) I have a log-on screen that is normally withdrawn, but under certain
conditions it is shown by a proc that main calls. When loading the app in
vtcl the window would always get shown (the "certain conditions" were
apparently met), and if I did not manually hide it again it would get saved
that way and then always get shown when I start up the application.
If I really need to I guess I could look to see if one of the vtcl global
vars exists [like vTcl(version)] to determine if it is running under vtcl
or not, and if so then skip the offending sections of code (or just
return???).
One other word of warning is to make sure all your opening and closing
braces match in your procedures. I've *painfully* lost several pieces of an
application because I saved it with ummatched braces. The problem actually
seems to be when vtcl loads the file back in (i.e. close it and then open
it)... I think it does not see the intended start and end of the
procedures. I have been able to recover from this by fixing the mismatched
braces with a text editor... but only if I catch it before I re-open the
file in vtcl and then overwrite it by saving it again. [I've actually now
taken to making backup copies between each invocation of vtcl to insure I
don't loose anything].
- Troy
---
R. Troy Monaghen | Alliance Systems Incorporated
[EMAIL PROTECTED] | [EMAIL PROTECTED]
http://www.mcs.net/~troy | http://www.alli.com