OTX Reference
|
|
Boolean value, which can be either true
or false
.
More...
Public Attributes | |
BooleanLiteral | init |
Cardinality [0..1] Initialisation of a Boolean declaration with a literal More... | |
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.
false
is assigned to the declaration. Conversion | Result | Sample |
---|---|---|
ToBoolean | Returns the copy of the value | Boolean b = ToBoolean(true); // Returns true
|
ToInteger | Returns 1 if the value is true , otherwise 0 | Integer i = ToInteger(true); // Returns 1
|
ToFloat | Returns 1.0 if the value is true , otherwise 0.0 | Float f = ToFloat(true); // Returns 1.0
|
ToString | Returns "true" if the value is true , otherwise "false" | String s = ToString(true); // Returns "true"
|
ToByteField | Returns 0x01 if the value is true, otherwise 0x00 | ByteField bf = ToByteField(true); // Returns 0x01
|
BooleanLiteral OpenTestSystem.Otx.Core.DataTypes.Boolean.init |
Cardinality [0..1]
Initialisation of a Boolean declaration with a literal