StructSort
StructSort(base
[,sorttype, sortorder, pathtosubelement
])
Returns an array of structures with the top-level key names sorted by
the subelement specified by
pathtosubelement
.
base
is a required parameter and specifies
the name of the top-level structure containing the element you want
to sort. sorttype
is an optional parameter
and specifies the type of sort to perform
(numeric
, text
, or
textnocase
). sortorder
is also optional and specifies the sort order for the operation
(asc
, for ascending (the default), or
desc
, for descending).
pathtosubelement
is optional and specifies
the path (using dot notation) from the
base
to the subelement you wish to sort
on. Leaving pathtosubelement
blank results
in the sort being performed on the top-level structure specified in
base
. Only substructures of structures may
be specified in pathtosubelement
.
Here’s an example that demonstrates the use of this
function: