Synergex.SynergyDE.Select.NoCaseOrderBy

WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
USupported on UNIX
VSupported on OpenVMS
namespace Synergex.SynergyDE.Select
public class OrderBy
public class NoCaseOrderBy extends OrderBy

The NoCaseOrderBy class extends the OrderBy class. Like the OrderBy class, the NoCaseOrderBy object is a collection of static methods for ordering a selection, either by key or non-key fields, when the selection is created. However, NoCaseOrderBy is designed for alpha fields that require a case-insensitive sort and cannot be used with integer fields, while OrderBy is case sensitive and can also be used with integer fields.

Important

Once created, any object used by the Select (From, Where, NoCaseWhere, GroupBy, NoCaseGroupBy, On, OrderBy, NoCaseOrderBy, and Sparse) must remain in contact with the same record(s) specified in the From object(s) as well as fields referenced in the Where, NoCaseWhere, GroupBy, NoCaseGroupBy, On, OrderBy, NoCaseOrderBy, and Sparse objects that are contained in the record(s). In other words, you can’t create one of these objects and pass it to another routine unless that routine has direct access to the original record. If this is not the case, an InvalidOperationException or $ERR_INVOPER error (“Where operator requires at least one field reference”) will result when creating the Select object. On the other hand, all data references outside a From object’s record are copied during the object’s creation and are not required to remain in contact with the original data.

Methods

Ascending

public static varargs Ascending(field1, ...), @NoCaseOrderBy

Declares a list of fields (MISMATCH n), separated by commas, by which the selected records will be sorted in ascending order upon being returned.

Descending

public static varargs Descending(field1, ...), @NoCaseOrderBy

Declares a list of fields (MISMATCH n), separated by commas, by which the selected records will be sorted in descending order upon being returned.

Operators

The logical and operator (&& or .AND.) is supported and is equivalent to its Synergy counterpart. See Expressions for more information about this operator.

Discussion

When Ascending() or Descending() is used, the entire selection is read from the specified file when the AlphaEnumerator object is created (on Select.GetEnumerator() or FOREACH). Changes to the file after making the selection may not be reflected in the records retrieved, especially if a record that matches the selection criteria is updated or inserted.

The fields specified by Ascending() and Descending() must be in the record specified in the From class object. If they are not, an InvalidOperationException or $ERR_INVOPER error (“Field reference not entirely part of specified record”) will be generated at runtime.

You can combine multiple fields in your sort criteria using the .AND. operator. For example,

sobj = new Select(from, wobj, 
&  NoCaseOrderBy.Descending(fld1).and.NoCaseOrderBy.Ascending(fld2))

If you need case-sensitive ordering of records, use Synergex.SynergyDE.Select.OrderBy. You can combine OrderBy and NoCaseOrderBy using .AND. if only some fields require case-insensitivity or if some fields are integer.

If you want to use the AscendingKey() or DescendingKey() methods, use OrderBy instead of NoCaseOrderBy.