ItemByNumber (GenericNamedArraylist property): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
m (1 revision)
Line 6: Line 6:
{{Template:GenericNamedArraylist:ItemByNumber syntax}}
{{Template:GenericNamedArraylist:ItemByNumber syntax}}
===Syntax terms===
===Syntax terms===
<dl>
<table class="syntaxTable">
<dt><i>%item</i>
<tr><th><i>%item</i></th>
<dd>A variable of the same
<td>A variable of the same type as specified on the ''%namrayl'' declaration to contain the value of the specified ''%namrayl'' item. Or a variable or value of the same type as specified on the ''%namrayl'' declaration to be assigned to the specified ''%namrayl'' item. </td></tr>
type as specified on the ''%namrayl'' declaration
<tr><th><i>%namrayl</i></th>
to contain the value of the specified ''%namrayl'' item.
<td>A NamedArraylist object. </td></tr>
Or a variable or value of the same
<tr><th><i>number</i></th>
type as specified on the ''%namrayl'' declaration
<td>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.</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==
==Usage notes==
<ul>
<ul>

Revision as of 23:09, 31 January 2011

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


This ReadWrite property returns or sets the NamedArraylist item that has the specified item number.

Syntax

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

Syntax terms

%item A variable of the same type as specified on the %namrayl declaration to contain the value of the specified %namrayl item. Or a variable or value of the same type as specified on the %namrayl declaration to be assigned to the specified %namrayl item.
%namrayl A NamedArraylist object.
number 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.

Usage notes

  • 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 NamedArraylist that has the indicated number, the result is one of the following actions:
    • The request is cancelled if the UseDefault property value is False.
    • The Default value is returned if the UseDefault property is True.
  • The Item property lets you retrieve or set an item using its item name.

See also