Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Tk/Tcl script '#ifdef...'

942 views
Skip to first unread message

Michael Ganley

unread,
Dec 30, 1994, 10:03:58 AM12/30/94
to
Is there a built-in method of "including" or "excluding" script lines
within a tcl-tk script - which would be analogous to #ifdef's and
#endif's in a C-program?

SO that when executing a script, a command line switch would cause script
lines that are "excluded" to be ignored, without slowing down the script.

I would guess 'probably not' because the script isn't compiled....but it
would be nice to somehow easily simulate this.....

any suggestions....without having to do some kind of manual comparing that
would slow down the script ?

-MG

Gerald W. Lester

unread,
Dec 30, 1994, 4:23:14 PM12/30/94
to

Try:

if $switch_present then {
do first thing
} else {
do second thing
}

Note that you can have procedure declarations in the conditional to define a
procedure one way or the other.

==========================================================================
* Gerald W. Lester ! Voice: (504)-889-2784 *
* Computerized Processes Unlimited ! FAX: (504)-889-2799 *
* 4200 S. I-10 Service Road, Suite #205 ! E-Mail: g...@cpu.com *
* Metairie, LA 70001 ! Hours: 09:00-17:00 CDT *
==========================================================================

lvi...@cas.org

unread,
Dec 30, 1994, 6:02:38 PM12/30/94
to

Check out the file in <URL:ftp://ftp.aud.alcatel.com/tcl/docs/> which
has listed as it's purpose a list of tips to speed up your tcl/tk apps -
sort of what you are asking for in reverse...
--
:s Great net resources sought...
:s Larry W. Virden INET: larry....@cas.org
:s <URL:http://www-bprc.mps.ohio-state.edu/cgi-bin/hpp?lvirden_sig.html>
The task of an educator should be to irrigate the desert not clear the forest.

Ioi Kim Lam

unread,
Dec 31, 1994, 4:43:14 PM12/31/94
to
: Is there a built-in method of "including" or "excluding" script lines

I guess, if you are willing to, you can always put #ifdef's into your
TCL source code and have CPP tp "compile" it ....


Ioi.

0 new messages