Technical data
8. Documentation for Developers
Data Types
Concerning data types please note that variables, based on the associated regular expression
are permanently assigned to a data type:
• Variables, starting with type “NUM” are numeric and contain positive integers
• Variables representing an N-variable for any kind of array are numeric as well
• all other variables are treated as strings
This means, among other things, that a variable of type ENUMERIC can not be used as an
index when accessing an array variable, even if you have checked at first that it is not empty.
The following code thus does not work as expected:
# TEST should be a variable of type ENUMERIC
if (test != "")
then
# Error: You can't use a non-numeric ID in a numeric
# context. Check type of operand.
set i=my_array[test]
# Error: You can't use a non-numeric ID in a numeric
# context. Check type of operand.
set j=test+2
fi
A solution for this problem is offered by split (Page 307):
if (test != "")
then
# all elemente of test_% are numeric
split(test, test_%, ' ', numeric)
# OK
set i=my_array[test_%[1]]
# OK
set j=test_%[1]+2
fi
Substitution of Strings and Variables
At various points strings are needed, such as when a Warning (Page 303) should be issued. In
some cases described in this documentation, such a string is scanned for variables. If found,
these are replaced by their contents or other attributes. This replacement is called variable
substitution.
This will be illustrated by an example. Assume this configuration:
# config/base.txt
HOSTNAME='fli4l'
# config/dns_dhcp.txt
HOST_N='1' # Number of hosts
HOST_1_NAME='client'
HOST_1_IP4='192.168.1.1'
300










