This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

!enable/!disable Scripts

Old posts that have not been replied to for several years.
Locked
p
phab
Voice
Posts: 12
Joined: Mon Aug 22, 2005 6:34 am

!enable/!disable Scripts

Post by phab »

Hey guys,

I wrote a small "script package". I have a "settings.tcl" where you can define settings for all the other scripts, and you can disable / enable them with "disable<script> 0/1". In every other script I'm checking if this value is 0/1 and then execute or not execute the proc.

Is there another way to do this, maybe a better one?

Thanks :-)
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Code: Select all

if {$variable} {
# if $variable is bigger or equal with 1 will execute this code
}

Code: Select all

if {!$variable} {
# if $variable is equal with 0 will execute this code
}
my 2 cents :)
Once the game is over, the king and the pawn go back in the same box.
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

you could spare memory if source componentN.tcl from the main script as necessary
Locked