Item (Arraylist property): Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
m (1 revision) |
||
Line 21: | Line 21: | ||
For instance, in the For loop in the | For instance, in the For loop in the | ||
[[Arraylist class]] example, <tt>print %alist(%i)</tt> is equivalent to: | [[Arraylist class]] example, <tt>print %alist(%i)</tt> is equivalent to: | ||
< | <p class="code">print %alist:<var>Item</var>(%i) | ||
</p> | |||
</ | |||
<li>Methods are available to retrieve or seet the first or just the last item in | <li>Methods are available to retrieve or seet the first or just the last item in | ||
an <var>Arraylist</var>. | an <var>Arraylist</var>. |
Revision as of 20:55, 28 January 2011
Return or set Arraylist item value (Arraylist class)
This ReadWrite property
returns or sets the indicated item in the Arraylist.
For additional description of this method, see Coding considerations for collections.
Syntax
%currentItem = al:Item( number) al:Item( number) = newItem
Syntax terms
%item | A variable of the same type as specified on the al declaration to contain the value of the specified al item. Or a variable or value of the same type as specified on the al declaration to be assigned to the specified al item. |
---|---|
al | An Arraylist object. |
number | A whole number greater than 0 to identify an al item by its position in the arraylist. If number is greater than the number of items in the al, or if it is less than or equal to zero, the request is cancelled. |
Usage notes
- The Item keyword is not required.
For instance, in the For loop in the
Arraylist class example, print %alist(%i) is equivalent to:
print %alist:Item(%i)
- Methods are available to retrieve or seet the first or just the last item in an Arraylist. See FirstItem and LastItem.