In the following example, the flow author wants the integer to be expressed as a string. At runtime, the expression results in the string “5”.
ToString(5)
This is an example of an explicit cast where the expression author is converting the integer value 5 to a string by adding a ToString function call and passing in the integer. The resulting value of this expression when evaluated at runtime will be “5”.
A flow author could also enter the following valid string expression:
ToString(3+4)
This expression is considered an explicit cast. The flow author directed the parser to convert the integer to a string. Implicit cast happens only on the resulting type of expression text entered.
A flow author can also enter this valid string expression:
3+4
With regard to “like” types, this expression is invalid because the expression attempts to assign an integer to a string, but we know that a string variable can only have a string assignment. But with implicit casting, Architect can resolve the expression. The parser adds the ToString value around the expression, which converts the integer to a string, returning this expression:
ToString(3+4)
When Architect performs an implicit cast, it returns a message with conversion details on the expression’s Edit Expression dialog box.
Note: These conversion messages only appear in the Edit Expression dialog box. They do not appear in field-level literal or expression modes. However, Architect converts the expression whether you enter it at field level or in the Edit Expression dialog box.
Implicit casts are only performed on type cast functions that take one parameter. Type cast functions with multiple allowed parameters are not candidates for implicit conversion because the parser cannot process the action on any parameter after the first one.