| View previous topic :: View next topic |
| Author |
Message |
phab Voice
Joined: 22 Aug 2005 Posts: 12
|
Posted: Mon Aug 22, 2005 6:40 am Post subject: !enable/!disable Scripts |
|
|
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  |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Mon Aug 22, 2005 10:02 am Post subject: |
|
|
| Code: |
if {$variable} {
# if $variable is bigger or equal with 1 will execute this code
}
|
| Code: |
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. |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Mon Aug 22, 2005 11:16 pm Post subject: |
|
|
| you could spare memory if source componentN.tcl from the main script as necessary |
|
| Back to top |
|
 |
|