New (SortedRecordset constructor): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
m (1 revision)
Line 1: Line 1:
 
{{Template:SortedRecordset:New subtitle}}
<span class="pageSubtitle"><section begin=dpl_desc/><section end=dpl_desc/></span>
[[Category:SortedRecordset methods|New constructor]]
<p>
<var>New</var> is a member of the <var>[[SortedRecordset class|SortedRecordset]]</var> class.
</p>


This shared function instantiates an empty instance of a <var>SortedRecordset</var> object.
This shared function instantiates an empty instance of a <var>SortedRecordset</var> object.
Line 12: Line 7:
in [[RecordsetCursor#Declaration and instantiation|"Declaration and instantiation"]].
in [[RecordsetCursor#Declaration and instantiation|"Declaration and instantiation"]].
==Syntax==
==Syntax==
<p class="syntax">%srecs = [class:]New
{{Template:SortedRecordset:New syntax}}
</p>
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
Line 23: Line 17:


</td></tr></table>
</td></tr></table>
==Usage Notes==
==Usage notes==
<ul>
<ul>
<li>If you are creating an extension class of the <var>SortedRecordset</var> class,
<li>If you are creating an extension class of the <var>SortedRecordset</var> class,
Line 49: Line 43:
</p>
</p>
</ul>
</ul>
==See also==
{{Template:SortedRecordset:New footer}}

Revision as of 01:24, 29 April 2011

Create a new SortedRecordset object (SortedRecordset class)


This shared function instantiates an empty instance of a SortedRecordset object.

Available as of Sirius Mods version 7.6, the New method is an alternative to using a Sort statement factory constructor, as described in "Declaration and instantiation".

Syntax

%sortedRecordset = [%(SortedRecordset In filOrGrp name):]New

Syntax terms

%srecs A declared SortedRecordset object including its file/group context.
class Either a parenthesized class name, as in %(SortedRecordset in file foo), or a non-parenthesized variable in the class, as in %srecs.

Usage notes

  • If you are creating an extension class of the SortedRecordset class, you can use New in the Construct statement in the extension class:

    class sordidSet extends sortedRecordset in sordid inherit ... constructor new construct %(sortedRecordset in sordid):new ... end constructor ... end class

    The Sort statement constructors cannot be used for this purpose.

Example

  • The New constructor has no parameters and simply instantiates an empty instance of its class:

    %srs is object SortedRecordset in sordid ... %srs = new

See also