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

Boolean value, which can be either true or false. More...

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

Public Attributes

BooleanLiteral init
 Initialisation of a Boolean declaration with a literal More...
 

Detailed Description

Boolean value, which can be either true or false.

OTX Boolean values have a value space of true, false, 1, 0. Even though 1 and 0 are contained in the value space, treating Boolean values like numeric values directly is not allowed by OTX. Boolean is the result data type of comparison and equality operations. A bool expression can be a controlling conditional expression in Branch, Loops etc.

Note
If a Boolean declaration is not explicitly initialized, false is assigned to the declaration.
Terms and Actions
List of some useful terms and actions:
Conversion Terms
ConversionResultSample
ToBooleanReturns the copy of the value
Boolean b = ToBoolean(true); // Returns true
ToIntegerReturns 1 if the value is true, otherwise 0
Integer i = ToInteger(true); // Returns 1
ToFloatReturns 1.0 if the value is true, otherwise 0.0
Float f = ToFloat(true); // Returns 1.0
ToStringReturns "true" if the value is true, otherwise "false"
String s = ToString(true); // Returns "true"
ToByteFieldReturns 0x01 if the value is true, otherwise 0x00
ByteField bf = ToByteField(true); // Returns 0x01
Syntax Declaration
Boolean Declaration [= BooleanLiteral];
Literal
true
false
Sample
Boolean BooleanVariable = true;

Member Data Documentation

◆ init

BooleanLiteral OpenTestSystem.Otx.Core.DataTypes.Boolean.init

Initialisation of a Boolean declaration with a literal