| | # A 'tconfpy' Example Configuration File |
---|
| | # Copyright 2003-2005 TundraWare Inc. |
---|
| | # $Id: example.cfg,v 1.106 2005/01/13 22:12:39 tundra Exp $ |
---|
| | # $Id: example.cfg,v 1.107 2005/01/14 09:53:18 tundra Exp $ |
---|
| | # |
---|
| | # This is designed to illustrate the various features |
---|
| | # of the 'tconfpy' configuration language. |
---|
| | # |
---|
| |
---|
| | bool1 = yEs |
---|
| | bool1 = 0 |
---|
| | bool1 = yessir # Error: Unrecognized boolean value |
---|
| | |
---|
| | |
---|
| | # Testing Booleans - The HARD WAY |
---|
| | |
---|
| | # No matter how you set it, the *value* of a boolean is always stored as |
---|
| | # 'True' or 'False'. This matters when doing Comparison Conditionals |
---|
| | |
---|
| | .if [bool1] == False |
---|
| |
---|
| | # something |
---|
| | |
---|
| | .endif |
---|
| | |
---|
| | |
---|
| | # Testing Booleans - The EASY WAY |
---|
| | |
---|
| | # Quick Review: If you do this, you are testing to see if a boolean |
---|
| | # variable *exists*: |
---|
| | # |
---|
| | # .ifall/any/none BoolVar1 BoolVar2 .... |
---|
| | # |
---|
| | # Ordinarily, [foo] returns the *value* of variable 'foo'. But in the |
---|
| | # case of booleans in an existential test, this construct returns the |
---|
| | # *logical state* of the boolean variable. So you can do things like: |
---|
| | |
---|
| | |
---|
| | bool1 = True |
---|
| | |
---|
| | .ifany [bool1] |
---|
| | |
---|
| | bool1was True |
---|
| | |
---|
| | .else |
---|
| | |
---|
| | bool1was False |
---|
| | |
---|
| | .endif |
---|
| | |
---|
| | # This only works *within existential tests* (.ifany, .ifall, .ifnone). |
---|
| | # Everywhere else, [BoolVar] will return one of the strings, 'True' or 'False'. |
---|
| | |
---|
| | |
---|
| | |