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:
Its declaration look like this: boolean
identifier
;
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
;
Its declaration look like this: date
identifier
;
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.
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
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.
Its declaration looks like this: number
identifier
;
The declaration looks like this: string
identifier
;
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:
list1=list2;
It means that both lists reference the same elements.
list1[ ]=list2;
It adds all elements of list2
to the
end of list1
.
list1[ ]="abc";
It adds the
string to the "abc"
list1
as its new
last element.
list1[ ]=NULL;
It removes the last element of the
list1
.
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.
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:
record (<metadata ID>) identifier;
record (@<port number>) identifier;
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.