ItemByNumber (GenericNamedArraylist property): Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
Line 1: | Line 1: | ||
{{Template:GenericNamedArraylist:ItemByNumber subtitle}} | {{Template:GenericNamedArraylist:ItemByNumber subtitle}} | ||
<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 item number. | <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. | ||
==Syntax== | ==Syntax== | ||
Line 12: | Line 12: | ||
<td>A <var>FloatNamedArraylist</var>, <var>NamedArraylist</var>, or <var>UnicodeNamedArraylist</var> object. </td></tr> | <td>A <var>FloatNamedArraylist</var>, <var>NamedArraylist</var>, or <var>UnicodeNamedArraylist</var> object. </td></tr> | ||
<tr><th>number</th> | <tr><th>number</th> | ||
<td>A whole number greater than 0 to identify a <var class="term">anyNal</var> item by its position in the | <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> | ||
<tr><th>newItem</th> | <tr><th>newItem</th> | ||
<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> | <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> | ||
Line 19: | Line 19: | ||
==Usage notes== | ==Usage notes== | ||
<ul> | <ul> | ||
<li>If the <var>ItemByNumber</var> property is being set and there is already an item on the <var>FloatNamedArraylist</var>, <var>NamedArraylist</var>, or <var>UnicodeNamedArraylist</var> that has the specified number, that item is replaced. If the <var>ItemByNumber</var> property is being set and there is no item on the <var>FloatNamedArraylist</var>, <var>NamedArraylist</var>, or <var>UnicodeNamedArraylist</var> that has the indicated number, the item is added. If the <var>ItemByNumber</var> property is being retrieved and there is no item on the <var>FloatNamedArraylist</var>, <var>NamedArraylist</var>, or <var>UnicodeNamedArraylist</var> that has the indicated number, the result is one of the following actions: | <li>If the <var>ItemByNumber</var> property is being set and there is already an item on the <var>FloatNamedArraylist</var>, <var>NamedArraylist</var>, or <var>UnicodeNamedArraylist</var> that has the specified number, that item is replaced. If the <var>ItemByNumber</var> property is being set and there is no item on the <var>FloatNamedArraylist</var>, <var>NamedArraylist</var>, or <var>UnicodeNamedArraylist</var> that has the indicated number, the item is added. | ||
<li>If the <var>ItemByNumber</var> property is being retrieved and there is no item on the <var>FloatNamedArraylist</var>, <var>NamedArraylist</var>, or <var>UnicodeNamedArraylist</var> that has the indicated number, the result is one of the following actions: | |||
<ul> | <ul> | ||
<li>The request is cancelled if the <var>[[UseDefault (NamedArraylist property)|UseDefault]]</var> property value is <code>False</code>. | <li>The request is cancelled if the <var>[[UseDefault (NamedArraylist property)|UseDefault]]</var> property value is <code>False</code>. |
Revision as of 20:43, 5 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. |
Usage notes
- If the ItemByNumber property is being set and there is already an item on the FloatNamedArraylist, NamedArraylist, or UnicodeNamedArraylist that has the specified number, that item is replaced. If the ItemByNumber property is being set and there is no item on the FloatNamedArraylist, NamedArraylist, or UnicodeNamedArraylist that has the indicated number, the item is added.
- If the ItemByNumber property is being retrieved and there is no item on the FloatNamedArraylist, NamedArraylist, or UnicodeNamedArraylist 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 request is cancelled if the UseDefault property value is
See also
- The Item properties for FloatNamedArraylist, NamedArraylist, and UnicodeNamedArraylist respectively, let you retrieve or set an item using its item key.