For the complete documentation index, see llms.txt. This page is also available as Markdown.

BoxSetToArray

Convert a Set to an Array, preserving the iteration order of the underlying variant.

For a LINKED Set the insertion order is preserved; for a SORTED Set the natural ordering applies; for a default hash Set the order is undefined. The source Set is not modified.

Method Signature

BoxSetToArray(set=[set])

Arguments

Argument
Type
Required
Description
Default

set

set

true

The set to convert.

Examples

Convert a Set to an Array

s = setNew( type="linked", values=[ "a", "b", "c" ] );
arr = s.toArray();
writeOutput( arr.len() & "," & arr[ 1 ] );

Result: 3,a

Sorted Set produces a sorted Array

Result: 1,9

Last updated

Was this helpful?