Difference between revisions of "Core.Terms.ToBoolean"
Jump to navigation
Jump to search
Line 5: | Line 5: | ||
== OTL Syntax == | == OTL Syntax == | ||
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
− | BooleanTerm = | + | BooleanTerm = ToBoolean(Term); |
</syntaxhighlight> | </syntaxhighlight> | ||
Line 37: | Line 37: | ||
Boolean Boolean3; | Boolean Boolean3; | ||
− | Boolean1 = | + | Boolean1 = ToBoolean(0); |
− | Boolean2 = | + | Boolean2 = ToBoolean("true"); |
− | Boolean3 = | + | Boolean3 = ToBoolean("false"); |
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 04:43, 2 May 2019
Contents
Classification
Name | ToBoolean |
Short Description | Converts an OTX term to a value of the Boolean data type |
Class | Term |
Extension | OTX Core library |
Group | Conversion terms |
Exceptions | - |
Checker Rules | - |
Standard Compliant | Yes |
OTL Syntax
BooleanTerm = ToBoolean(Term);
Description
This term will return the Boolean counterpart of the argument term.
Return Value
The Term returns the value, see table below.
![]()
In OTX, Terms are categorized according to its return data type!
Data Type | Description |
Boolean | Returns the Boolean counterpart of the argument term. |
Rules
- Boolean
- Returns a copy of the value
- Integer
- If 0, return false , otherwise true
- Float
- If 0.0, return false , otherwise true
- ByteField
- If empty, return false , otherwise true
- String
- If the value of the string "True", and not taken into account - insensitive will return true , otherwise false
Properties
Name | Data Type | Class | Default | Cardinality | Description |
Term | - | Term | - | [1] | Represents the OTX term that will be converted to a new value of the Boolean data type. See conversion rule descriptions above. |
OTL Examples
Boolean Boolean1;
Boolean Boolean2;
Boolean Boolean3;
Boolean1 = ToBoolean(0);
Boolean2 = ToBoolean("true");
Boolean3 = ToBoolean("false");