StructToSorted
Method Signature
StructToSorted(struct=[structloose], sortType=[any], sortOrder=[string], localeSensitive=[any], callback=[function:Comparator])Arguments
Argument
Type
Required
Description
Default
Examples
structToSorted with an inline function sorting by key value
someStruct = {
"NINE" : 9,
"SIX" : 6,
"THREE" : 3,
"TWELVE" : 12,
"tres" : 3,
"seis" : 6,
"nueve" : 9,
"doce" : 12
};
function sortByNumericValuesDescending( Any value1, Any value2, Any key1, Any key2 ) {
if( value1 > value2 ) {
return -1;
}
return 1;
}
sortedStruct = StructToSorted( someStruct, sortByNumericValuesDescending );
writedump( sortedStruct );
structToSorted member function with an inline function sorting by key value
structToSorted member function with an inline function sorting by key name
structToSorted member function with sorttype argument
Additional Examples
Related
Last updated
Was this helpful?
