FIELDTYPE Function

Returns the field type of a field output from the parent node. If the second parameter is supplied, it is set to the length in chars if the field type is string.

Category: Data Input
Returned data type: Character

Syntax

FIELDTYPE(<(index, length>)

Required Argument

<index>

specifies the index into the incoming fields from the parent node. The second parameter is optional and set to the maximum string length in characters if the field type is a string.

Optional Argument

<length>

specifies an integer that contains the length of the field if the field is of type string.

Details

The FIELDTYPE function determines the type and, the maximum length in characters (for string fields) based on its index in the list of fields coming from the parent node. It returns a string representation of the field type (for example, integer or date).

Example

// Declare a hidden integer for the for loop, initializing it to 0
hidden integer i
i = 0
 
// Increment through the data a number of times equal to the number 
// of fields in the data
for i = 1 to fieldcount()
 
//Check the type of each field in the data and take some action
if fieldtype(i) == 'Date' then