Next: Scalars
Up: The Scripting Language
Previous: Error Reporting
Contents
Index
Data Types
Variables may be one of several different types. The types that
are currently implemented are listed below.
- no type
Before a variable receives an assignment, it has no type, but behaves
in all respects as a string with a value of the variable name.
- string
The string type contains text data.
- scalar
Scalars are real numbers that are stored internally in
double-precision floating point format. Conversion to integer values,
such as for array subscription, is performed automatically where
needed.
- array
The array type contains a 1-3 dimensional array of numerical values.
- handle
The handle type contains a reference to a complex data object. There
are a number of different object types that can be referenced by
handles.
- zoidlist
Zoidlists contain a list of trapezoids that define spatial regions.
- lexper
This variable type contains a parse tree for a ``layer expression''
(see 10.1). A layer expression is a logical expression
involving layer names.
The type of a variable is determined by its assignment, or in the case
of arrays, by declaration. Once a type is assigned, it is generally
an error to assign a different type. Exceptions are the undefining of
array pointers (to be discussed) and the promotion of scalars to
handles when a handle is assigned to a scalar. Variables that are
referenced before assignment behave as strings with a string value set
to the variable name. For example, if an unassigned variable is
passed to one of the print functions the name of that variable will be
printed. Type identification of a literal is by context. A quoted
quantity is always taken to be a string, e.g., "2.345" is a
string. Quote marks can be included in strings by preceding them with
a backslash. A number in integer, floating, or exponential format is
always taken as a scalar.
Subsections
Next: Scalars
Up: The Scripting Language
Previous: Error Reporting
Contents
Index
Stephen R. Whiteley
2006-10-23