New (SortOrder constructor): Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
m (1 revision) |
||
Line 12: | Line 12: | ||
</th><td>A <var>SortOrder</var> object variable to contain the new object instance. | </th><td>A <var>SortOrder</var> object variable to contain the new object instance. | ||
</td></tr> | </td></tr> | ||
<tr><th nowrap="true"><var>[%(SortOrder For < | <tr><th nowrap="true"><var>[%(SortOrder For </var>itemType<var>)]</var></th> | ||
<td>The optional class name in parentheses denotes a <var>[[Notation conventions for methods#Constructors|Constructor]]</var>. See [[#Usage notes|"Usage notes"]], below, for more information about invoking a <var>SortOrder</var> <var>Constructor</var>. | <td>The optional class name in parentheses denotes a <var>[[Notation conventions for methods#Constructors|Constructor]]</var>. See [[#Usage notes|"Usage notes"]], below, for more information about invoking a <var>SortOrder</var> <var>Constructor</var>. | ||
</td></tr> | </td></tr> |
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)