Language Reference Guide : System Classes : ArrayObject Class : Sort Method
 
Share this page          
Sort Method
The Sort method sorts array objects on one attribute or a set of attributes.
This method has the following syntax:
integer = ArrayObject.Sort(attributename = order
          {, attributename = order})
This method has the following parameter:
attributename
Specifies any attribute in the array with a simple data type or one of the allowable object types (DateObject, FloatObject, IntegerObject, MoneyObject, or StringObject) can be used as a sort key.
The order must be either AS_ASC or AS_DESC. The most significant sort key is first in the list. For attributes of an allowable object type, the sort uses the object's Value attribute.
When the sort is done, all table fields that display the named array are automatically updated. The Sort method returns ER_OK, if it is successful, or a non-zero value if it is not. Descriptions of system constant values and their numeric equivalents are listed in Error Codes.
See the Programming Guide for a detailed discussion of using this method.