Difference between revisions of "Core.Terms.ToString"
Jump to navigation
Jump to search
m (Hb moved page ToString to Core.Terms.ToString: #3153) |
|||
(6 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | [[Category:Core]] | + | {{DISPLAYTITLE:OTX '''ToString'''}}[[Category:Core]] |
== Classification == | == Classification == | ||
− | {{ClassificationActivity | ToString | | + | {{ClassificationActivity | ToString | Converts an OTX term to a value of the String data type | [[Term]] | [[Core|OTX Core library]] | [[Conversion terms]] | - | - }} |
== Pseudo-Code Syntax == | == Pseudo-Code Syntax == | ||
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
− | StringTerm | + | StringTerm ToString(Term) |
</syntaxhighlight> | </syntaxhighlight> | ||
== Description == | == Description == | ||
− | + | This term will return the String counterpart of the argument term. | |
− | {{TermReturnValue| [[String]] | | + | {{TermReturnValue| [[Core.DataTypes.SimpleDataType.String|String]] | Returns the String counterpart of the argument term.}} |
== Rules == | == Rules == | ||
* '''Boolean''' | * '''Boolean''' | ||
− | *: Returns {{FontColor|red||"true"}} if {{FontColor|blue||true}}, otherwise {{FontColor|red||"false"}} | + | *: Returns {{FontColor|red||"true"}} if {{FontColor|blue||true}}, otherwise {{FontColor|red||"false"}}. |
* '''Integer''' | * '''Integer''' | ||
− | *: Returns a decimal number as a string | + | *: Returns a decimal number as a string. |
* '''Float''' | * '''Float''' | ||
− | *: Returns the floating-point number as a string with a "." (Point) as the decimal separator. | + | *: Returns the floating-point number as a string with a "." (Point) as the decimal separator. For an overview about string representations of floats see [https://docs.oracle.com/javase/specs/jls/se6/html/lexical.html#3.10.2 §3.10.2 of The Java™ Language Specification]. |
* '''ByteField''' | * '''ByteField''' | ||
− | *: Returns an interpretation of the ByteFields to UTF-8 | + | *: Returns an interpretation of the ByteFields to UTF-8. |
* '''String''' | * '''String''' | ||
− | *: Returns a copy of the value | + | *: Returns a copy of the value. |
* '''List''' | * '''List''' | ||
− | *: Returns the list in the form of a [[ListLiteral]]s , for example: "{1, 2, 3} | + | *: Returns the string of the list in the form of a [[Core.Terms.ListLiteral|ListLiteral]]s , for example: "{1, 2, 3}". |
* '''Map''' | * '''Map''' | ||
− | *: Returns the map in the form of a [[MapLiteral]]s , for example: "{ | + | *: Returns the string of the map in the form of a [[Core.Terms.MapLiteral|MapLiteral]]s , for example: "{"key1"=1, "key2"=2, "key3"=3}". |
== 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 String data type. See conversion rule descriptions above.}} |
|} | |} | ||
== Examples == | == Examples == | ||
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
+ | /// Local Declarations | ||
+ | |||
String String1; | String String1; | ||
String String2; | String String2; | ||
String String3; | String String3; | ||
String String4; | String String4; | ||
+ | String String5; | ||
+ | String String6; | ||
+ | String String7; | ||
+ | |||
+ | /// Flow | ||
− | String1 = | + | String1 = ToString(true); |
− | String2 = | + | String2 = ToString(1234); |
− | String3 = | + | String3 = ToString(123.456); |
− | String4 = | + | String4 = ToString(&18 00 FF FF); |
+ | String5 = ToString("the same"); | ||
+ | String6 = ToString({1, 2, 3}); | ||
+ | String7 = ToString({"key1"=1, "key2"=2, "key3"=3}); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== See also == | == See also == | ||
− | [[ToBoolean]] <br/> | + | [[Core.Terms.ToBoolean|ToBoolean]] <br/> |
− | [[ToInteger]] <br/> | + | [[Core.Terms.ToInteger|ToInteger]] <br/> |
− | [[ToFloat]] <br/> | + | [[Core.Terms.ToFloat|ToFloat]] <br/> |
− | [[ToByteField]] | + | [[Core.Terms.ToByteField|ToByteField]] |
Latest revision as of 02:13, 7 May 2019
Contents
Classification
Name | ToString |
Short Description | Converts an OTX term to a value of the String data type |
Class | Term |
Extension | OTX Core library |
Group | Conversion terms |
Exceptions | - |
Checker Rules | - |
Standard Compliant | Yes |
Pseudo-Code Syntax
StringTerm ToString(Term)
Description
This term will return the String 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 |
String | Returns the String counterpart of the argument term. |
Rules
- Boolean
- Returns "true" if true , otherwise "false" .
- Integer
- Returns a decimal number as a string.
- Float
- Returns the floating-point number as a string with a "." (Point) as the decimal separator. For an overview about string representations of floats see §3.10.2 of The Java™ Language Specification.
- ByteField
- Returns an interpretation of the ByteFields to UTF-8.
- String
- Returns a copy of the value.
- List
- Returns the string of the list in the form of a ListLiterals , for example: "{1, 2, 3}".
- Map
- Returns the string of the map in the form of a MapLiterals , for example: "{"key1"=1, "key2"=2, "key3"=3}".
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 String data type. See conversion rule descriptions above. |
Examples
/// Local Declarations
String String1;
String String2;
String String3;
String String4;
String String5;
String String6;
String String7;
/// Flow
String1 = ToString(true);
String2 = ToString(1234);
String3 = ToString(123.456);
String4 = ToString(&18 00 FF FF);
String5 = ToString("the same");
String6 = ToString({1, 2, 3});
String7 = ToString({"key1"=1, "key2"=2, "key3"=3});