File: variable-directives.rst

package info (click to toggle)
brltty 6.8-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 35,776 kB
  • sloc: ansic: 150,447; java: 13,484; sh: 9,667; xml: 5,702; tcl: 2,634; makefile: 2,328; awk: 713; lisp: 366; python: 321; ml: 301
file content (147 lines) | stat: -rw-r--r-- 3,975 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
The Assign Directive
--------------------

.. parsed-literal:: assign *variable* *value*

Use this directive to create or update a variable associated with
the current nesting level (see `The BeginVariables Directive`_)
of the current include level (see `The Include Directive`_).
The variable is visible to the current and to lower include levels,
but not to higher include levels.

*variable*
   The name of the variable. If the variable doesn't already exist at the
   current include level then it is created.

*value*
   The value that is to be assigned to the variable. If it's not supplied then
   a zero-length (null) value is assigned.

Examples::

   assign nullValue
   assign shortValue word
   assign longValue a\svalue\swith\sspaces
   assign IndirectValue \{variableName}

The AssignDefault Directive
---------------------------

.. parsed-literal:: assignDefault *variable* *value*

Use this directive to assign a default value to a variable associated with
the current nesting level (see `The BeginVariables Directive`_)
of the current include level (see `The Include Directive`_).
It's functionally equivalent to:

.. parsed-literal:: ifNotVar *variable* assign *variable* *value*

See `The Assign Directive`_ and `The IfNotVar Directive`_ for more details.

*variable*
   The name of the variable. If the variable doesn't already exist at the
   current include level then it is created. If it does already exist then it
   is **not** modified.

*value*
   The value that is to be assigned to the variable if it doesn't already
   exist. If it's not supplied then a zero-length (null) value is assigned.

Examples::

   assignDefault format plain\stext

The AssignGlobal Directive
--------------------------

.. parsed-literal:: assignGlobal *variable* *value*

Use this directive to create or update a variable associated with
the global level. The variable is visible to all include levels.
See `The Assign Directive`_ for more details.

*variable*
   The name of the variable. If the variable doesn't already exist at the
   global level then it is created.

*value*
   The value that is to be assigned to the variable. If it's not supplied then
   a zero-length (null) value is assigned.

Examples::

   assignGlobal packageName BRLTTY

The IfVar Directive
-------------------

.. parsed-literal:: ifVar *variable* *directive*

Use this directive to only process one or more directives if a variable exists.

*variable*
   The name of the variable whose existence is to be tested.

*directive*
   |directive operand|

Examples::

   ifVar var1 ifVar var2 assign concatenation \{var1}\{var2}

The IfNotVar Directive
----------------------

.. parsed-literal:: ifNotVar *variable* *directive*

Use this directive to only process one or more directives if a variable doesn't
exist.

*variable*
   The name of the variable whose existence is to be tested.

*directive*
   |directive operand|

Examples::

   ifNotVar var1 assign var1 default\svalue

The BeginVariables Directive
----------------------------

.. parsed-literal:: beginVariables

Use this directive to open a new variable nesting level.
`The Assign Directive`_) will define variables at this new nesting level,
and will hide variables with the same names in any previous nesting level.
These variables will remain defined until `The EndVariables Directive`_
that is at the same variable nesting level.

Examples::

   assign x 1
   # \{x} evaluates to 1
   beginVariables
   # \{x} still evaluates to 1
   assign x 2
   # \{x} now evaluates to 2
   endVariables
   # \{x} evaluates to 1 again

The EndVariables Directive
--------------------------

.. parsed-literal:: endVariables

Use this directive to close the current variable nesting level.
See `The BeginVariables Directive`_ for details.

The ListVariables Directive
---------------------------

.. parsed-literal:: listVariables

Use this directive to list all of the currently defined variables.
It can be helpful when debugging.