Data Types in CTL

For basic information about data types used in metadata see Data Types and Record Types

In any program, you can use some variables. Data types in CTL can be the following:

boolean

Its declaration look like this: boolean identifier;

bytearray

This data type is an array of bytes of a length that can be up to Integer.MAX_VALUE as a maximum. It behaves similarly to the list data type (see below).

Its declaration looks like this: bytearray [(size)] identifier;

date

Its declaration look like this: date identifier;

decimal

Its declaration looks like this: decimal[(length,scale)] identifier;

The default length and scale are 8 and 2, respectively.

The default values of DECIMAL_LENGTH and DECIMAL_SCALE are contained in the org.jetel.data.defaultProperties file and can be changed to other values.

You can cast any float number to the decimal data type by apending the d letter to its end.

int

Its declaration looks like this: int identifier;

If you apend an l letter to the end of any integer number, you can cast it to the long data type

long

Its declaration looks like this: long identifier;

Any integer number can be cast to this data type by apending an l letter to its end.

number (double)

Its declaration looks like this: number identifier;

string

The declaration looks like this: string identifier;

list

Each list is a container of one the following primitive data types: boolean, byte, date, decimal, integer, long, number, string.

The list data type is indexed by integers starting from 0.

Its declaration looks like this: list identifier;

The default list is an empty list.

Examples:

list list2; examplelist2[5]=123;

Assignments:

map

This data type is a container of any data type.

The map is indexed by strings.

Its declaration looks like this: map identifier;

The default map is an empty map.

Example: map map1; map1["abc"]=true;

The assignments are similar to those valid for a list.

record

This data type is a set of fields of data.

The structure of record is based on metadata.

Its declaration can look like one of these options:

  1. record (<metadata ID>) identifier;

  2. record (@<port number>) identifier;

  3. record (@<metadata name>) identifier;

For more detailed information about possible expressions and records usage see Accessing Data Records and Fields.

The variable does not have a default value.

It can be indexed by both integer numbers and strings. If indexed by numbers, fields are indexed starting from 0.