OTX Reference  
OpenTestSystem.Otx.Core.DataTypes.List Class Reference

List of items of the same data type. More...

Inheritance diagram for OpenTestSystem.Otx.Core.DataTypes.List:
Inheritance graph

Public Attributes

ListLiteral init
 Initialisation of a List declaration More...
 
DataType itemType
 Data type of the List elements More...
 

Detailed Description

List of items of the same data type.

An OTX List consists of an arbitrary number of items of the same data type. At the declaration the list's item data type must be defined. The length of a list can be modified by the sequence by deleting or adding items. Insertion of items can be done at every position. In that case, the existing elements move one index further. The inverse happens when items are deleted from a list. Some list modification actions and list access terms are listed as below.

Note
If a List declaration is not explicitly initialized, an empty list will be created and assigned to the List identifier.
Terms and Actions
List of some useful terms and actions:.
Conversion Terms
ConversionResultSample
ToBooleanUndefined, do not use it!
ToIntegerUndefined, do not use it!
ToFloatUndefined, do not use it!
ToStringReturns the list as a Literal
String s = ToString({ true, false, true }); // Returns "{ true, false, true }"
ToByteFieldUndefined, do not use it!
Syntax Declaration
List<DataType> Declaration [= ListLiteral];
Literal
{ element1, element2, ... }
Sample
List<Boolean> ListVariable = { true, false, true };
See also
DataTypes.Map

Member Data Documentation

◆ init

ListLiteral OpenTestSystem.Otx.Core.DataTypes.List.init

Initialisation of a List declaration

This optional element stands for the initialisation of the List at declaration time. Initialisation is done by using a recursive mechanism: E.g. A list of lists of integers is initialised by using list literals for each list-type item again, and so on.

Sample
List<Integer> ListVariable1 = {1, 4, 2};
List<String> ListVariable1 = {"Hello", "World"};
List<List<Float>> ListVariable1 = {{0.1, 2.3}, {4.5, 6.7, 8.9}};

◆ itemType

DataType OpenTestSystem.Otx.Core.DataTypes.List.itemType

Data type of the List elements