Difference between revisions of "Core.Terms.ToBoolean"
Jump to navigation
Jump to search
(16 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | [[Category:Core]] | + | {{DISPLAYTITLE:OTX '''ToBoolean'''}}[[Category:Core]] |
== Classification == | == Classification == | ||
− | {{ClassificationActivity | ToBoolean | | + | {{ClassificationActivity | ToBoolean | Converts an OTX term to a value of the Boolean data type | [[Term]] | [[Core|OTX Core library]] | [[Conversion terms]] | - | - }} |
− | == | + | == OTL Syntax == |
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
− | + | BooleanTerm ToBoolean(Term) | |
</syntaxhighlight> | </syntaxhighlight> | ||
== Description == | == Description == | ||
− | + | This term will return the Boolean counterpart of the argument term. | |
− | {{TermReturnValue| [[Boolean]] | | + | {{TermReturnValue| [[Core.DataTypes.SimpleDataType.Boolean|Boolean]] | Returns the Boolean counterpart of the argument term.}} |
== Rules == | == Rules == | ||
* '''Boolean''' | * '''Boolean''' | ||
− | *: Returns a copy of the value | + | *: Returns a copy of the value. |
* '''Integer''' | * '''Integer''' | ||
− | *: | + | *: Returns {{FontColor|blue||false}} if 0, otherwise {{FontColor|blue||true}}. |
* '''Float''' | * '''Float''' | ||
− | *: | + | *: Returns {{FontColor|blue||false}} if 0.0, otherwise {{FontColor|blue||true}}. |
* '''ByteField''' | * '''ByteField''' | ||
− | *: | + | *: Returns {{FontColor|blue||false}} if empty, otherwise {{FontColor|blue||true}}. |
* '''String''' | * '''String''' | ||
− | *: | + | *: Returns {{FontColor|blue||true}} if the string value is "true", ignoring case, otherwise {{FontColor|blue||false}}. |
== Properties == | == Properties == | ||
{| {{TableHeader}} | {| {{TableHeader}} | ||
{{TableRowPropertiesHeader}} | {{TableRowPropertiesHeader}} | ||
− | {{TableRowPropertie1| Term | - | [[Term]] | - | [1] | | + | {{TableRowPropertie1| 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.}} |
|} | |} | ||
− | == Examples == | + | == OTL Examples == |
+ | /// Global Declarations | ||
+ | |||
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
− | + | Boolean Boolean1; | |
− | + | Boolean Boolean2; | |
− | + | Boolean Boolean3; | |
+ | Boolean Boolean4; | ||
+ | Boolean Boolean5; | ||
+ | |||
+ | /// Flow | ||
+ | |||
+ | Boolean1 = ToBoolean(true); | ||
+ | Boolean2 = ToBoolean(0); | ||
+ | Boolean3 = ToBoolean(0.00001); | ||
+ | Boolean4 = ToBoolean(&00); | ||
+ | Boolean5 = ToBoolean("tRuE"); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== See also == | == See also == | ||
− | [[ToInteger]] <br/> | + | [[Core.Terms.ToInteger|ToInteger]] <br/> |
− | [[ToFloat]] <br/> | + | [[Core.Terms.ToFloat|ToFloat]] <br/> |
− | [[ToByteField]] <br/> | + | [[Core.Terms.ToByteField|ToByteField]] <br/> |
− | [[ToString]] | + | [[Core.Terms.ToString|ToString]] |
Latest revision as of 04:10, 7 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
- Returns false if 0, otherwise true .
- Float
- Returns false if 0.0, otherwise true .
- ByteField
- Returns false if empty, otherwise true .
- String
- Returns true if the string value is "true", ignoring case, 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
/// Global Declarations
Boolean Boolean1;
Boolean Boolean2;
Boolean Boolean3;
Boolean Boolean4;
Boolean Boolean5;
/// Flow
Boolean1 = ToBoolean(true);
Boolean2 = ToBoolean(0);
Boolean3 = ToBoolean(0.00001);
Boolean4 = ToBoolean(&00);
Boolean5 = ToBoolean("tRuE");