Item (UnicodeNamedArraylist property): Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
m (match syntax table to diagram, lots of tags, some edits) |
||
Line 1: | Line 1: | ||
{{Template:UnicodeNamedArraylist:Item subtitle}} | {{Template:UnicodeNamedArraylist:Item subtitle}} | ||
<var>Item</var> is a ReadWrite property returns or sets the value of the item that has the specified subscript name in the <var>UnicodeNamedArraylist</var>. | |||
specified subscript name in the UnicodeNamedArraylist. | |||
For additional comments about the Item method in collections, see [[Collections#Coding considerations for collections|"Coding considerations for collections"]]. | |||
==Syntax== | ==Syntax== | ||
{{Template:UnicodeNamedArraylist:Item syntax}} | {{Template:UnicodeNamedArraylist:Item syntax}} | ||
===Syntax terms=== | ===Syntax terms=== | ||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
<tr><th>% | <tr><th>%currentItem</th> | ||
<td>A variable of the same type as specified on the | <td>A variable of the same type as specified on the <var class="term">uniNal</var> declaration to contain the value of the specified <var class="term">uniNal</var> item.</td></tr> | ||
<tr><th> | <tr><th>uniNal</th> | ||
<td>A UnicodeNamedArraylist object. </td></tr> | <td>A <var>UnicodeNamedArraylist</var> object. </td></tr> | ||
<tr><th> | <tr><th>unicode</th> | ||
<td>A Unicode string that serves as a subscript to identify a | <td>A Unicode string that serves as a subscript to identify a <var class="term">uniNal</var> item.</td></tr> | ||
<tr><th>newItem</th> | |||
<td>A variable or value of the same type as specified on the <var class="term">uniNal</var> declaration to be assigned to the specified <var class="term">uniNal</var> item. </td></tr> | |||
</table> | </table> | ||
==Usage notes== | ==Usage notes== | ||
<ul> | <ul> | ||
<li>The < | <li>The <code>Item</code> keyword is not required. For example, in the request in the [[UnicodeNamedArraylist class]] example, <code>%k('&sect;Apr':u) = 'Leo'</code>, for instance, is equivalent to: | ||
For example, in the request in the | |||
[[UnicodeNamedArraylist class]] example, < | |||
instance, is equivalent to: | |||
<p class="code">%k:Item('&sect;Apr':u) = 'Leo' | <p class="code">%k:Item('&sect;Apr':u) = 'Leo' | ||
</p> | </p> | ||
<li>If the Item property is being set and there is already an item | <li>If the <var>Item</var> property is being set and there is already an item on the <var>UnicodeNamedArraylist</var> that has the specified name, that item is replaced. If the <var>Item</var> property is being set and there is no item on the <var>UnicodeNamedArraylist</var> that has the indicated name, the item is added. If the <var>Item</var> property is being retrieved and there is no item on the <var>UnicodeNamedArraylist</var> that has the indicated name, the result is one of the following actions: | ||
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: | |||
<ul> | <ul> | ||
<li>The request is cancelled if the | <li>The request is cancelled if the <var>[[UseDefault (UnicodeNamedArraylist property)|UseDefault]]</var> property value is <code>False</code>. | ||
[[UseDefault (UnicodeNamedArraylist property)|UseDefault]] property value is < | <li>The <var>[[Default (UnicodeNamedArraylist property)|Default]]</var> value is returned if the <var>UseDefault</var> property is <code>True</code>. | ||
<li>The [[Default (UnicodeNamedArraylist property)|Default]] value is returned if the | |||
UseDefault property is < | |||
</ul> | </ul> | ||
<li>As shown in the example in the [[UnicodeNamedArraylist class]] article, | <li>As shown in the example in the [[UnicodeNamedArraylist class]] article, <var>UnicodeNamedArraylist</var> items are ordered alphabetically by their subscript names. Accordingly, the <var>Item</var> method takes a Unicode string as it's argument. | ||
UnicodeNamedArraylist items are ordered alphabetically by their subscript names. | |||
Accordingly, the Item method takes a Unicode string ' | |||
</ul> | </ul> | ||
==See also== | ==See also== | ||
<ul><li>The <var>[[ItemByNumber_(GenericNamedArraylist_property)|ItemByNumber]]</var> method, described below, lets you retrieve or set an item using the item's ordinal number. | |||
<li>The <var>[[NameByNumber (UnicodeNamedArraylist property)|NameByNumber]]</var> function lets you retrieve or set an item using the item's subscript name. | |||
</ul> | |||
{{Template:UnicodeNamedArraylist:Item footer}} | {{Template:UnicodeNamedArraylist:Item footer}} |
Revision as of 09:20, 4 March 2011
Value of named item (UnicodeNamedArraylist class)
Item is a 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
%currentItem | A variable of the same type as specified on the uniNal declaration to contain the value of the specified uniNal item. |
---|---|
uniNal | A UnicodeNamedArraylist object. |
unicode | A Unicode string that serves as a subscript to identify a uniNal item. |
newItem | A variable or value of the same type as specified on the uniNal declaration to be assigned to the specified uniNal item. |
Usage notes
- The
Item
keyword is not required. For example, in the request in the UnicodeNamedArraylist class example,%k('§Apr':u) = 'Leo'
, for instance, is equivalent to:%k:Item('§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
.
- The request is cancelled if the UseDefault property value is
- 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 as it's argument.
See also
- 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.