The FOR EACH statement, OPEN QUERY statement, and PRESELECT option may use multiple indexes to satisfy a query. When multiple indexes are used, the order of returned records is not guaranteed. You can enforce an order by using the BY option.
The following example returns the selected Customer records in ascending CreditLimit order and within CreditLimit in Name order:
FOR EACH Customer BY Customer.CreditLimit BY Customer.Name: