Difference between revisions of "Core.Terms.ToInteger"
Jump to navigation
Jump to search
m (Hb moved page ToInteger to Core.Terms.ToInteger: #3153) |
|||
Line 1: | Line 1: | ||
− | [[Category:Core]] | + | {{DISPLAYTITLE:OTX '''ToInteger'''}}[[Category:Core]] |
== Classification == | == Classification == | ||
{{ClassificationActivity | ToInteger | To convert an expression to a Integer | [[Term]] | [[Core|OTX Core library]] | [[Conversion terms]] | - | - }} | {{ClassificationActivity | ToInteger | To convert an expression to a Integer | [[Term]] | [[Core|OTX Core library]] | [[Conversion terms]] | - | - }} | ||
Line 11: | Line 11: | ||
Term to the convert an expression to a Integer. | Term to the convert an expression to a Integer. | ||
− | {{TermReturnValue| [[Integer]] | Return value of the appropriate type.}} | + | {{TermReturnValue| [[Core.DataTypes.SimpleDataType.Integer|Integer]] | Return value of the appropriate type.}} |
== Rules == | == Rules == | ||
Line 23: | Line 23: | ||
*: Returns the integer value of the ByteFields. The byte sequence is interpreted unsigned. | *: Returns the integer value of the ByteFields. The byte sequence is interpreted unsigned. | ||
* '''String''' | * '''String''' | ||
− | *: Returns the integer value of the string. The string must conform to an [[IntegerLiteral]]. If not, an exception is thrown. | + | *: Returns the integer value of the string. The string must conform to an [[Core.Terms.IntegerLiteral|IntegerLiteral]]. If not, an exception is thrown. |
== Properties == | == Properties == | ||
Line 45: | Line 45: | ||
== See also == | == See also == | ||
− | [[ToBoolean]] <br/> | + | [[Core.Terms.ToBoolean|ToBoolean]] <br/> |
− | [[ToFloat]] <br/> | + | [[Core.Terms.ToFloat|ToFloat]] <br/> |
− | [[ToByteField]] <br/> | + | [[Core.Terms.ToByteField|ToByteField]] <br/> |
− | [[ToString]] | + | [[Core.Terms.ToString|ToString]] |
Revision as of 03:26, 5 February 2016
Contents
Classification
Name | ToInteger |
Short Description | To convert an expression to a Integer |
Class | Term |
Extension | OTX Core library |
Group | Conversion terms |
Exceptions | - |
Checker Rules | - |
Standard Compliant | Yes |
OTL Syntax
IntegerTerm = Conversion.ToInteger(Term);
Description
Term to the convert an expression to a Integer.
Return Value
The Term returns the value, see table below.
![]()
In OTX, Terms are categorized according to its return data type!
Data Type | Description |
Integer | Return value of the appropriate type. |
Rules
- Boolean
- Returns 1 if true , otherwise 0
- Integer
- Returns a copy of the value
- Float
- Return the integer part (value) left beside the point. The decimal part is this truncated and not rounded.
- ByteField
- Returns the integer value of the ByteFields. The byte sequence is interpreted unsigned.
- String
- Returns the integer value of the string. The string must conform to an IntegerLiteral. If not, an exception is thrown.
Properties
Name | Data Type | Class | Default | Cardinality | Description |
Term | - | Term | - | [1] | The expression to be converted. Rules, see description. |
OTL Examples
Integer Integer1;
Integer Integer2;
Integer Integer3;
Integer Integer4;
Integer1 = Conversion.ToInteger(true);
Integer2 = Conversion.ToInteger("1234");
Integer3 = Conversion.ToInteger(123.456);
Integer4 = Conversion.ToInteger(&18 00 FF FF);