Home · Search · Print · Help
Constants
PGL supports constants of several types.
1. Boolean constants
Supported boolean constants are: no, false,
off, yes, true, and on.
2. Numbers
Integer and floating point constants are supported. An integer
constant is simply a sequence of digits. A floating point number is
two sequences of digits separated by a period. Exponential notation
for floating point numbers is also supported.
17
1.23
1e34
1.20e-12
A handy ``percent'' representation is also available: appending an
& sign to a number is the same as dividing that number by 100. The
following constants are equal.
30%
0.30
0.3
3. Strings
String constants are formed by double-quoting text.
"string"
"this is a string"
4. Time constants
Time constants are numbers immediately followed by time ``scale''
tags. Recognized tags are msec, sec, min,
hour, day, and year. The number part is
optional and defaults to 1. If the number part is present, the
ms, s, and hr tags can also be used, but do
not do that. The following constants are equal.
min
1min
60sec
5. Size constants
Size constants are numbers immediately followed by size ``scale''
tags. Recognized tags are Byte, Kb, KB,
MB, Mb, Gb, and GB. The number
part is optional and defaults to 1. The following constants are equal.
KB
1KB
8Kb
1024Byte
6. Network addresses
Network addresses are formed by surrounding an address with single
quotes. Details like network interface name, port number, and subnet
can be used where appropriate.
'10.0.0.1'
'10.0.0.1:80'
'fxp0::10.0.0.1:80'
'fxp0::10.0.0.0:80/16'
'www.host1.com'
'www.host2.com:8080'
Address ranges (i.e., address array constants) are also supported.
'10.0.1-4.1-250'
'10.0.1-4.17/24'
'www.host[1-4].com:80'
Home · Search · Print · Help
|