Added August 2023
ASB provides a convenience operator used to assign elements to an array in a single operation from a CSV-formatted string:
a() = <string-expr>
Where:
a() is a DIMX array of strings
<string-expr> is a string expression in a CSV compatible format.
The operation follows the same general rules as INPUT CSV into an array, i.e. the array elements can be fixed length or dynamic strings and the array extent can be fixed or auto_extend. In the case of an auto_extend array, the extent will be reset for each assignment statement. Likewise, the string expression can have comma, tab or pipe delimiters and may contain quoted elements; leading and trailing spaces are trimmed.
Example
dimx a(0), s, 0, auto_extend
a() = "red,green,blue"
a() = "Golden Retriever | Doberman | German Shepard | Chihuahua"
History
2023 September, A-Shell 6.5.1741: The CSV assignment convenience operator (see 6.5.1739.0) now recognizes the delimiter set via MX_CSVDELIM.
2023 August, A-Shell 6.5.1739: Feature added to A-Shell.