Item (FloatNamedArraylist property): Difference between revisions
Jump to navigation
Jump to search
m (→Usage Notes) |
m (→Usage Notes) |
||
Line 12: | Line 12: | ||
see [[Collections#Coding considerations for collections|Coding considerations for collections]]. | see [[Collections#Coding considerations for collections|Coding considerations for collections]]. | ||
==Syntax== | ==Syntax== | ||
<p class="code">%item = %fnamrayl:Item(subscript) | |||
%fnamrayl:Item(subscript) = %item | |||
</p> | |||
===Syntax Terms=== | ===Syntax Terms=== | ||
<dl> | <dl> | ||
Line 36: | Line 37: | ||
[[FloatNamedArraylist class]] example, <tt>%y(7) = 'seven'</tt>, for instance, is | [[FloatNamedArraylist class]] example, <tt>%y(7) = 'seven'</tt>, for instance, is | ||
equivalent to: | equivalent to: | ||
< | <p class="code">%y:item(7) = 'seven' | ||
</p> | |||
</ | |||
<li>If the Item property is being set and there is already an item | <li>If the Item property is being set and there is already an item | ||
on the FloatNamedArraylist that has the specified subscript, that item is replaced. | on the FloatNamedArraylist that has the specified subscript, that item is replaced. |
Revision as of 20:54, 28 January 2011
<section begin=dpl_desc/>Value of item specified by subscript<section end=dpl_desc/>
Item is a member of the FloatNamedArraylist class.
This ReadWrite property returns or sets the value of the item that has the specified subscript number in the FloatNamedArraylist.
For additional comments about the Item method in collections, see Coding considerations for collections.
Syntax
%item = %fnamrayl:Item(subscript) %fnamrayl:Item(subscript) = %item
Syntax Terms
- %item
- A variable of the same type as specified on the %fnamrayl declaration to contain the value of the specified %fnamrayl item. Or a variable or value of the same type as specified on the %fnamrayl declaration to be assigned to the specified %fnamrayl item.
- %fnamrayl
- A FloatNamedArraylist object.
- subscript
- A number that serves as a subscript to identify a %fnamrayl item.
Usage Notes
- The Item keyword is not required.
For example, in the request in the
FloatNamedArraylist class example, %y(7) = 'seven', for instance, is
equivalent to:
%y:item(7) = 'seven'
- If the Item property is being set and there is already an item
on the FloatNamedArraylist that has the specified subscript, that item is replaced.
If the Item property is being set and there is no item on the FloatNamedArraylist
that has the indicated subscript, the item is added.
If the Item property is being retrieved and there is no item on the FloatNamedArraylist
that has the indicated subscript, the result is one of the following actions:
- The request is cancelled if the UseDefault UseDefault property value is False.
- The Default value is returned if the UseDefault property is True.
- As shown in the example in the FloatNamedArraylist class article, FloatNamedArraylist items are ordered numerically by their subscript numbers. Accordingly, the Item method takes a numerical subscript argument. The ItemByNumber method, described below, lets you retrieve or set an item using the item's ordinal number. The NameByNumber property lets you retrieve or set an item using the item's subscript number.