Define members of the Data Structure

Every member of the Data Structure type has a type and a name. The type can be either another KCM type (including other Data Structure types) or an ARRAY or a MAP of variables of a KCM type.

type Name 
MAP type Name 
ARRAY type Name 
ARRAY type Name [number] (* Optional number of elements -- is ignored *) 
FIELDSET Name 
FIELDSET Name DEFINED_AS OtherName 

You can define FIELDSET members using the DEFINED_AS keyword. This keyword indicates that the member should be treated as a Field Set with the alternative name when constructing Content Wizards or inserting Text Blocks.

The following requirements apply to the members:

  • The name of the members must begin with an uppercase character and is limited to uppercase characters, lower-case characters, digits, and underscores. Spaces are not allowed.
  • The name must be unique in the Data Structure.
  • The name cannot be a keyword in the Template scripting language. To avoid conflicts, including with future extensions to the language, do not use all capitals for the name.
  • TYPE can be any accepted KCM type including previously declared Data Structure types.
  • The size of the ARRAY members is optional. Any value specified here is ignored when a Data Structure variable is declared and the initial size is always 0.

You can define Data Structure members inline in the definition. For more information, see Inline DATASTRUCTURE definitions.

The following example defines the Data Structure type Relation with five members.

DATASTRUCTURE Relation 
BEGIN 
		NUMBER CustomerNumber 
		NUMBER Age 
		FIELDSET Person 
		FIELDSET Partner DEFINED_AS Person 
		ARRAY FIELDSET Children DEFINED_AS Person (* Array of 'Person' Field Sets 
*) 
END 

The Partner member and each element in the Children ARRAY is treated as if it is a Person Field Set.

The following command defines the Data Structure type Policy.

DATASTRUCTURE Policy 
BEGIN 
		TEXT PolicyNumber 
		NUMBER InsuredAmount 
		FIELDSET PolicyData 
		Relation Insured 												(* Data Structure *) 
		ARRAY Relation Benificiaries (* Array of Data Structures *) 
END 

The Insured and Benificiaries members have the previously declared Relation Data Structure type.