ItemByNumber (GenericNamedArraylist property): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
 
(10 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<span style="font-size:120%; color:black"><b><section begin=dpl_desc/>Value of numbered item<section end=dpl_desc/></b></span>
{{Template:GenericNamedArraylist:ItemByNumber subtitle}}
[[Category:NamedArraylist methods|ItemByNumber property]]
 
<!--DPL?? Category:NamedArraylist methods|ItemByNumber property: Value of numbered item-->
<var>ItemByNumber</var> is a ReadWrite property that returns or sets the <var>FloatNamedArraylist</var>, <var>NamedArraylist</var>, or <var>UnicodeNamedArraylist</var> item that has the specified ordinal item number.
<p>
ItemByNumber is a member of the [[NamedArraylist class]].
</p>


This ReadWrite property returns or sets the NamedArraylist item that has
the specified item number.
==Syntax==
==Syntax==
  %item = %namrayl:ItemByNumber(number)
{{Template:GenericNamedArraylist:ItemByNumber syntax}}
 
===Syntax terms===
  %namrayl:ItemByNumber(number) = %item
<table class="syntaxTable">
===Syntax Terms===
<tr><th>%currentItem</th>
<dl>
<td>A variable of the same type as specified on the <var class="term">anyNal</var> declaration to contain the value of the specified <var class="term">anyNal</var> item.</td></tr>
<dt><i>%item</i>
<tr><th>anyNal</th>
<dd>A variable of the same
<td>A <var>FloatNamedArraylist</var>, <var>NamedArraylist</var>, or <var>UnicodeNamedArraylist</var> object. </td></tr>
type as specified on the ''%namrayl'' declaration
<tr><th>number</th>
to contain the value of the specified ''%namrayl'' item.
<td>A whole number greater than 0 to identify a <var class="term">anyNal</var> item by its position in the ordered <var>FloatNamedArraylist</var>, <var>NamedArraylist</var>, or <var>UnicodeNamedArraylist</var>. If <var class="term">number</var> is greater than the number of items in <var class="term">anyNal</var>, or if it is less than or equal to zero, the request is cancelled.</td></tr>
Or a variable or value of the same
<tr><th>newItem</th>
type as specified on the ''%namrayl'' declaration
<td>A variable or value of the same type as specified on the <var class="term">anyNal</var> declaration to be assigned to the specified <var class="term">anyNal</var> item. </td></tr>
to be assigned to the specified ''%namrayl'' item.
</table>
<dt><i>%namrayl</i>
<dd>A NamedArraylist object.
<dt><i>number</i>
<dd>A whole number greater than 0 to identify a ''%namrayl'' item
by its position
in the alphabetically ordered NamedArraylist.
If ''number'' is greater than the number of items in ''%namrayl'',
or if it is less than or equal to zero, the request is cancelled.
 
</dl>
==Usage Notes==
<ul>
<li>If the ItemByNumber property is being set and there is already an item
on the NamedArraylist that has the specified number, that item is replaced.
 
If the ItemByNumber property is being set and there is no item on the
NamedArraylist that has the indicated number, the item is added.


If the ItemByNumber property is being retrieved and there is no item on the
==See also==
NamedArraylist that has the indicated number,
<ul><li>The <var>Item</var> properties for <var>[[Item_(FloatNamedArraylist_property)|FloatNamedArraylist]]</var>, <var>[[Item (NamedArraylist property)|NamedArraylist]]</var>, and <var>[[Item_(UnicodeNamedArraylist_property)|UnicodeNamedArraylist]]</var> respectively, let you retrieve or set an item using its item key.</ul>
the result is one of the following actions:
{{Template:GenericNamedArraylist:ItemByNumber footer}}
<ul>
<li>The request is cancelled if the
[[UseDefault (NamedArraylist property)|UseDefault]] property value is <tt>False</tt>.
<li>The [[Default (NamedArraylist property)|Default]] value is returned if the
UseDefault property is <tt>True</tt>.
</ul>
<li>The [[Item (NamedArraylist property)|Item]] property lets you retrieve or
set an item using its item name.
</ul>

Latest revision as of 03:18, 8 August 2012

Return or set item using item number (FloatNamedArraylist, NamedArraylist, and UnicodeNamedArraylist classes)


ItemByNumber is a ReadWrite property that returns or sets the FloatNamedArraylist, NamedArraylist, or UnicodeNamedArraylist item that has the specified ordinal item number.

Syntax

%currentItem = anyNal:ItemByNumber( number) anyNal:ItemByNumber( number) = newItem

Syntax terms

%currentItem A variable of the same type as specified on the anyNal declaration to contain the value of the specified anyNal item.
anyNal A FloatNamedArraylist, NamedArraylist, or UnicodeNamedArraylist object.
number A whole number greater than 0 to identify a anyNal item by its position in the ordered FloatNamedArraylist, NamedArraylist, or UnicodeNamedArraylist. If number is greater than the number of items in anyNal, or if it is less than or equal to zero, the request is cancelled.
newItem A variable or value of the same type as specified on the anyNal declaration to be assigned to the specified anyNal item.

See also