Understanding Con2Str() Function in Container in X++
☰Fullscreen
Table of Content:
- This a Global class method which retrieves a string of the elements in the specified container. If no value for the sep parameter is specified, the comma character will be inserted between elements in the returned string. The returned string cannot have more than 1000 characters.
- Syntax: client server public static str Con2Str(container c, [str sep])
- c - The container to convert.
- sep - The string to use as a separator between elements; optional.
Example:
Code:
static void Container_con2StrExample(Args _args) { // container declaration and initialization with 2 values container containerName = ["Hello", 1202]; str charHolder; int conLength, cnt; ; // con2Str() function gets values as str comma separated from the container info(strFmt("Container containerName con2Str() values are :- %1", con2Str(containerName))); }
Output:
The above code will produce the following result-
Container containerName con2Str() values are :- Hello,1202