OTX Reference  
OpenTestSystem.Otx.Core.Terms.ToString Class Reference

Convert expression to String More...

Inheritance diagram for OpenTestSystem.Otx.Core.Terms.ToString:
Inheritance graph

Public Attributes

Term term
 The expression (term) to be converted to String More...
 
- Public Attributes inherited from OpenTestSystem.Otx.Core.Terms.Term
MetaData metaData
 Store additional More...
 

Detailed Description

Convert expression to String

The ToString term returns the String equivalent of the argument. If the argument is Boolean true it returns "true" and if Boolean false it returns "false". If the argument is Float or Integer it returns the string interpretation of the value. If the argument a ByteField it returns the UTF-8 interpretation of the string value.

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.
  • 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}".
Checker rules
CheckerRule.Core_Chk062 – – usage of string:Decode instead of ToString for ByteFields
Exceptions
Core.Exceptions.OutOfBoundsExceptionIt is thrown in the ByteField case only: if the value cannot be interpreted as string in UTF-8 format. This exception is listed here for compatibility with the 2012 edition of the standard.It will never be thrown, as specified above.
Syntax
StringTerm = ToString(Term)
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});

Member Data Documentation

◆ term

Term OpenTestSystem.Otx.Core.Terms.ToString.term

The expression (term) to be converted to String