Synergex.SynergyDE.Select.NoCaseOrderBy

Order a selection (case insensitive)

WSupported on Windows
USupported on Unix
VSupported on OpenVMS
NSupported in Synergy .NET
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.

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. When used with a JoinSelect, the fields can be from any record in any of the joined From objects and can be specified in any order. However, specified fields must have unambiguous names, so if fields in different records have the same name, you must include the record name in addition to the field name.

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.