I guess you could use [info script] for this.
Also, in the latest CVS code, you can write:
IgnoreProc pattern
(the pattern uses the string match convention)
to prevent procs from being inserted into your project. Because IgnoreProc
is part of vTcl, you need check if you are inside vTcl (when you are
outside vTcl sourcing is no more a problem):
if {[info exists vTcl(sourcing)]} {
# this will ignore all procs in ::myNamespace
IgnoreProc ::myNamespace::*
# this will ignore proc HelloWorld
IgnoreProc HelloWorld
}
Using IgnoreProc will make sure your sourced procs won't get saved again
into your project.
CG
|---------+------------------------------------->
| | Kenneth Jacker |
| | <[EMAIL PROTECTED]> |
| | Sent by: |
| | [EMAIL PROTECTED]|
| | ceforge.net |
| | |
| | |
| | 02/22/2002 05:58 AM |
| | Please respond to khj |
| | |
|---------+------------------------------------->
>------------------------------------------------------------------------------------------------------------------------------|
|
|
| To: [EMAIL PROTECTED]
|
| cc:
|
| Fax to:
|
| Subject: Re: [vtcl-user] Separating GUI/Processing Code
|
|
|
>------------------------------------------------------------------------------------------------------------------------------|
Thanks Bob and Damon for your continuing help!
Here was my first attempt at a revised /init/ proc within the
standard /vtcl/ project file:
proc {init} {argc argv} {
uplevel #0 source applprocs.tcl
}
When I opened the project, I got a "file 'applprocs.tcl' not found"
error message since I didn't start /vtcl/ from within the project
directory. Does vTcl have a variable containing the current project
directory? I tried using "$env(PWD)", but that gave my $HOME instead
of the project directory path. If vTcl provides this, I could then
change the above 'uplevel' to something like:
uplevel #0 source $vTcl:projDir/applprocs.tcl
Of course, I could just explicitly include the full path (that's what
I did to get things working immediately), but I'd rather make this
more general and less error prone.
Thanks again,
-Kenneth
PS Testing the above a bit, I notice that all the procs I have defined
in "applprocs.tcl" get copied into the main vTcl project file.
Changing the "applprocs.tcl" file (unfortunately) requires me to
use File/Source ..., but things appear to work.
Is there a way to make the "sourcing" automatic? Should I not
worry about the two occurrences of all my proc definitions?
_______________________________________________
vtcl-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/vtcl-user
_______________________________________________
vtcl-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/vtcl-user