DECLARE directive

Declares one or more customized data structures.

Options

TYPE = text Single-valued text defining the type of structure to declare
MODIFY = string token Whether to modify (instead of redefining) existing structures (yes, no); default no

Parameters

IDENTIFIER = identifiers Identifiers of the structures
VALUES = pointers Values for each structure
EXTRA = texts Extra text associated with each identifier

Description

DECLARE is used to set up compound data structures of a customized type. The form of each customized type is defined using the STRUCTURE directive. So, for example, after defining a complex_number type, by

STRUCTURE [NAME='complex_number'] 'real','imaginary';\

  TYPE='scalar'

we can declare a complex number C by

DECLARE [TYPE='complex_number'] C; VALUES=!p(3,2)

The VALUES parameter allows values to be defined for the structure, similarly to the VALUES parameter of the POINTER directive. So, here, the real part of the number C['real'] is given the value 3, and the imaginary part C['imaginary'] has the value 2. The EXTRA parameter is also used as in the POINTER directive, enabling extra text to be associated with the structure for annotation, and the MODIFY option allows an existing structure to be modified.

Options: TYPE, MODIFY.

Parameters: IDENTIFIER, VALUES, EXTRA.

See also

Directives: STRUCTURE, POINTER, LRV, SSPM, TSM.

Commands for: Data structures.

Updated on March 8, 2019

Was this article helpful?