diff --git a/tconfpy.3 b/tconfpy.3 index 9c49659..bbd9512 100644 --- a/tconfpy.3 +++ b/tconfpy.3 @@ -1312,7 +1312,118 @@ fi -.SS Pre-Defined Variables +.SS Predefined Variables + +\*(TC predefines a number of variables. The \'NAMESPACE\' variable we +discussed in the previous section is one of them, but there are a number +of others of which you should be aware. Note that all predefined variables +.B are relative to the root namespace. +Except for the \'NAMESPACE\' variable, they are all Read Only and +cannot be modified in your configuration file. + +The first group of predefined variables are called "System Variables". +As the name implies, they provide information about the system on +which you're running. These are primarily useful when doing +conditional tests (described later in this document). For example, +by doing conditional tests with System Variables you can have +one configuration file that works on both Unix and Windows operating +systems. The System Variables are: + +.nf + Variable Name Contains + ------------- -------- + + .MACHINENAME - The name of the computer on which you are running. + May also include full domain name, depending on system. + + .OSDETAILS - Detailed information about the operating system in use. + + .OSNAME - The name of the operating system in use. + + .OSRELEASE - The version of the operating system in use. + + .PLATFORM - The generic type of the operating system in use. + + .PYTHONVERSION - The version of Python in use. +.fi + +By combining these System Variables as well as the content of +selected Environment Variables, you can create complex conditional +configurations that "adapt" to the system on which a Python +application is running. For example: + +.nf + + .if [.MACHINENAME] == foo.bar.com + BKU = tar + + .else + + BKU = [$BACKUPPROGRAM] + + .endif +.fi + +The other kind of predefined variables are called "Reserved Variables". +\*(TC understands a number of symbols as part of its own language. +For example, the string \'#\' tells \*(TC to begin a comment until +end-of-line. There may be times, however, when +.B you +need these strings for your own use. In other words, you would like +to use one of the strings which comprise the \*(TC language for your +own purposes and have \*(TC ignore them. The Reserved Variables +give you a way to do this. The Reserved Variables are: + +.nf + Variable Name Contains + ------------- -------- + + DELIML [ + DELIMR ] + DOLLAR $ + ELSE .else + ENDIF .endif + ENDLITERAL .endliteral + EQUAL = + EQUIV == + HASH # + IF .if + IFALL .ifall + IFANY .ifall + IFNONE .ifnone + INCLUDE .include + LITERAL .literal + NOTEQUIV != + PERIOD . + +.nf + +For instance, suppose you wanted to include the \'#\' symbol +in the value of one of your variables. This will not work, +because \*(TC interprets it as the beginning of a comment, +which is not what you want: + +.nf + MyJersey = Is #23 +.fi + +So, we use one of the Reserved Variables to get what we want: + +.nf + MyJersey = Is [HASH]23 +.fi + +One word of warning, though. At the end of the day, you still have +to create variable names or namespace names that are legal. You +can't "sneak" illegal characters into these names using Reserved +Variables: + +.nf + foo = [DOLLAR]MyNewNamespace # No problem + NAMESPACE = [foo] # No way - namespace cannot start with $ +.fi + + .SS The \'.include\' Directive