Item (UnicodeNamedArraylist property): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
m (1 revision)
Line 1: Line 1:
<span style="font-size:120%; color:black"><b><section begin=dpl_desc/>Value of named item<section end=dpl_desc/></b></span>
{{Template:UnicodeNamedArraylist:Item subtitle}}
[[Category:UnicodeNamedArraylist methods|Item property]]
<!--DPL?? Category:UnicodeNamedArraylist methods|Item property: Value of named item-->
<p>
Item is a member of the [[UnicodeNamedArraylist class]].
</p>


This ReadWrite property returns or sets the value of the item that has the
This ReadWrite property returns or sets the value of the item that has the
Line 12: Line 7:
see [[Collections#Coding considerations for collections|Coding considerations for collections]].
see [[Collections#Coding considerations for collections|Coding considerations for collections]].
==Syntax==
==Syntax==
  %item = %unamrayl:Item(name)
{{Template:UnicodeNamedArraylist:Item syntax}}
 
===Syntax terms===
  %unamrayl:Item(name) = %item
===Syntax Terms===
<dl>
<dl>
<dt><i>%item</i>
<dt><i>%item</i>
Line 31: Line 24:


</dl>
</dl>
==Usage Notes==
==Usage notes==
<ul>
<ul>
<li>The <tt>Item</tt> keyword is not required.
<li>The <tt>Item</tt> keyword is not required.
Line 62: Line 55:
lets you retrieve or set an item using the item's subscript name.
lets you retrieve or set an item using the item's subscript name.
</ul>
</ul>
==See also==
{{Template:UnicodeNamedArraylist:Item footer}}

Revision as of 19:43, 28 January 2011

Value of named item (UnicodeNamedArraylist class)


This ReadWrite property returns or sets the value of the item that has the specified subscript name in the UnicodeNamedArraylist.

For additional comments about the Item method in collections, see Coding considerations for collections.

Syntax

%currentItem = uniNal:Item( unicode) uniNal:Item( unicode) = newItem Throws ItemNotPresent

Syntax terms

%item
A variable of the same type as specified on the %unamrayl declaration to contain the value of the specified %unamrayl item. Or a variable or value of the same type as specified on the %unamrayl declaration to be assigned to the specified %unamrayl item.
%unamrayl
A UnicodeNamedArraylist object.
name
A Unicode string that serves as a subscript to identify a %unamrayl item.

Usage notes

  • The Item keyword is not required. For example, in the request in the UnicodeNamedArraylist class example, %k('&sect;Apr':u) = 'Leo', for instance, is equivalent to:
        %k:Item('&sect;Apr':u) = 'Leo'
    
  • If the Item property is being set and there is already an item on the UnicodeNamedArraylist that has the specified name, that item is replaced. If the Item property is being set and there is no item on the UnicodeNamedArraylist that has the indicated name, the item is added. If the Item property is being retrieved and there is no item on the UnicodeNamedArraylist that has the indicated name, 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.
  • As shown in the example in the UnicodeNamedArraylist class article, UnicodeNamedArraylist items are ordered alphabetically by their subscript names. Accordingly, the Item method takes a Unicode string name argument. The ItemByNumber method, described below, lets you retrieve or set an item using the item's ordinal number. The NameByNumber function lets you retrieve or set an item using the item's subscript name.

See also