Data Elements in Configuration Files
Literal strings, string lists, and numeric data can appear as
data elements in configuration files. Only integral numbers are
allowed. The configuration file does not recognize floating point
numbers. You use data elements in directives
or expressions to describe file names
or other values.
Numeric data is handled in the following ways:
- Decimal or hexadecimal integer constants are represented
as in C and C++.
- The allowed range of numeric values is same as the range
for C and C++ long integers.
- In conditional expressions, a zero represents false and
other values represent true.
- When a number appears where a string is expected, the
number is converted to a string.
String data is handled in the following ways:
- You can use a variable that
represents a string value wherever you can use a string.
- A string can be a set of literal characters enclosed in
double or single quotation marks. If a string is enclosed
in double quotation marks, a backslash character in the
string begins an escape sequence. Escape sequences are
interpreted as they are in C and C++ source. In a string
enclosed in single quotation marks, a backslash is an
ordinary character. Use single quoted strings for
convenience when specifying file and path names that
include backslash characters. The following table shows
how string literals are interpreted.
| String Literal |
Contents of the String |
| 'D:\testing\newfile' |
D:\testing\newfile |
| "D:\testing\newfile" |
D: esting
ewfile |
- In build options, a literal string that is not enclosed
in single or double quotation marks is interpreted as a
variable name. The option specification is in error if
the name is not a valid identifier. For example, the
following two lines are not equivalent and the second has
an error because mapfile.lst is not a valid identifier.
option link(map, "mapfile.lst")
option link(map, mapfile.lst)
- You can omit the quotation marks when specifying option
values that are recognized by VisualAge C++. You can also
omit the quotation marks around strings that contain a
single token of only alphanumeric characters and are not
the same as the identifiers for any variables. For
example, the following two lines are equivalent:
option link(map, "no")
option link(map, no)
- In conditional expressions, an empty string is false and
a string that contains at least one character is true.
- The keyword null represents an empty string.
- A string list is a list of strings separated by commas.
Use string lists to supply more than one value. For
example, the following source directive includes a string
list of three file names:
source "cx45a.cpp", "cx48c.cpp", "cx4x.hpp"
- A string can be the concatenation of strings. Unlike in C
or C++, no function or operator is explicitly specified
to concatenate strings. The parts of a concatenated
string are strings separated by spaces, and each part can
be a variable or literal string. The following lines
define string variables x and y, and then assign the
value "abcdefghi" to string z by concatenating
x, "def", and y:
x = "abc"
y = "ghi"
z = x "def" y
- Strings can be built from factored parts. Brackets, [ and
], delimit a list of parts to be concatenated with other
string parts, as in the following example:
// equivalent to Mylist = "far", "fat", "fan"
MyPrefix = "fa"
MyList = MyPrefix [ "r", "t", "n" ]

Configuration Files
How Configuration Files Are
Processed

Change a Build Setup
Build

Configuration File Directives
Build Options