New (SortOrder constructor): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
m (1 revision)
(No difference)

Revision as of 18:45, 24 August 2011

Create a new, null SortOrder (SortOrder class)


The SortOrder instance created by New is empty, that is, without a sorting order or sorting key. Applied as the parameter of a collection class sorting method, an empty SortOrder produces a copy of the input collection.

Syntax

%sortOrder = [%(SortOrder For itemType):]New

Syntax terms

%sortOrder A SortOrder object variable to contain the new object instance.
[%(SortOrder For itemType)] The optional class name in parentheses denotes a Constructor. See "Usage notes", below, for more information about invoking a SortOrder Constructor.

Usage notes

  • As described in "Using New or other Constructors", New can be invoked with no object, with an explicit class specification, or with an object variable in the class, even if that object is Null:

    %sord = new %sord = %(SortOrder for object stringlist):new %sord = %sord:new

    Note: As shown above, if you explicitly specify the class name, you must include the item datatype of the collection to be sorted, just as on a SortOrder object variable's declaration.

    New can also be invoked directly as a parameter of a Sort subroutine or SortNew function:

    %arraylist2 = %arraylist1:sortnew(new)

See also