New (GenericNamedArraylist constructor): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
mNo edit summary
Line 1: Line 1:
{{Template:GenericNamedArraylist:New subtitle}}
{{Template:GenericNamedArraylist:New subtitle}}
This method returns a new instance of a <var>FloatNamedArraylist</var>, <var>NamedArraylist</var>, or <var>UnicodeNamedArraylist</var> object.


==Syntax==
==Syntax==
{{Template:GenericNamedArraylist:New syntax}}
{{Template:GenericNamedArraylist:New syntax}}
===Syntax terms===
===Syntax terms===
<dl>
<table class="syntaxTable">
<dt><i>%namrayl</i>
<tr><th>%anyNal</th>
<dd>A NamedArraylist object that is set to a new NamedArraylist object reference.
<td>A <var>NamedArraylist</var>, <var>FloatNamedArraylist</var>, or <var>UnicodeNamedArraylist</var> object variable that is set, respectively, to a new <var>NamedArraylist</var>, <var>FloatNamedArraylist</var>, or <var>UnicodeNamedArraylist</var> object reference.</td></tr>
<tr><th><var>%(GenericNamedArraylist)</var></th>
<td>The optional class name in parentheses denotes a <var>[[Notation conventions for methods#Constructors|Constructor]]</var>. See "Usage notes," below, for more information about invoking a collection <var>Constructor</var>.
</table>


</dl>
==Usage notes==
==Usage notes==
<ul>
<ul>
<li>New is a constructor and as such can be called with no
<li>As described in [[Object variables#Using New or other Constructors|"Using New or other Constructors"]], <var>New</var> can be invoked with no object, with an explicit class name, or with an object variable, even if that object is <var>Null</var>:
object, with an explicit class name, or with an object variable,
<p class="code">%anyNal = new
even if that object is null:
 
<pre style="xmp">
%anyNal = %(GenericNamedArraylist of float):new
    %namrayl = new
 
    %namrayl = %(namedArraylist):new
%anyNal = %anyNal:new
    %namrayl = %namrayl:new
</p>
</pre>
'''Note:'''
:note
As shown above, when explicitly indicating the
When using the second of these syntax options of New, which explicitly indicates the
class, both the collection and the item datatype must be
class, both the collection and item datatypes must be
specified just as they are on the collection variable's declaration:
specified just as they are on the collection variable's declaration:
<pre style="xmp">
<p class="code">%namrayl  is collection NamedArraylist of longstring
    %namrayl  is collection NamedArraylist of longstring
%namrayl  = %(NamedArraylist of longstring):new
    %namrayl  = %(NamedArraylist of longstring):new
</p>
</pre>
</ul>
</ul>
==See also==
==See also==
{{Template:GenericNamedArraylist:New footer}}
{{Template:GenericNamedArraylist:New footer}}

Revision as of 23:42, 26 July 2011

Create a new GenericNamedArraylist object (FloatNamedArraylist, NamedArraylist, and UnicodeNamedArraylist classes)


This method returns a new instance of a FloatNamedArraylist, NamedArraylist, or UnicodeNamedArraylist object.

Syntax

%anyNal = [%(GenericNamedArraylist Of itemType):]New

Syntax terms

%anyNal A NamedArraylist, FloatNamedArraylist, or UnicodeNamedArraylist object variable that is set, respectively, to a new NamedArraylist, FloatNamedArraylist, or UnicodeNamedArraylist object reference.
%(GenericNamedArraylist) The optional class name in parentheses denotes a Constructor. See "Usage notes," below, for more information about invoking a collection Constructor.

Usage notes

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

    %anyNal = new %anyNal = %(GenericNamedArraylist of float):new %anyNal = %anyNal:new

    Note: As shown above, when explicitly indicating the class, both the collection and the item datatype must be specified just as they are on the collection variable's declaration:

    %namrayl is collection NamedArraylist of longstring %namrayl = %(NamedArraylist of longstring):new

See also