FirstItem (GenericNamedArraylist property): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (typo fix)
 
(One intermediate revision by one other user not shown)
Line 3: Line 3:
==Syntax==
==Syntax==
{{Template:GenericNamedArraylist:FirstItem syntax}}
{{Template:GenericNamedArraylist:FirstItem syntax}}
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%currentItem</th>
<tr><th>%currentItem</th>
<td>A variable of the same type as specified on the <var class="term">anyNal</var> declaration to contain the value of the specified <var class="term">anyNal</var> item.</td></tr>
<td>A variable of the same type as specified on the <var class="term">anyNal</var> declaration to contain the value of the specified <var class="term">anyNal</var> item.</td></tr>
<tr><th>anyNal</th>
<tr><th>anyNal</th>
<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>newItem</th>
<tr><th>newItem</th>
<td>A 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 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 15: Line 18:
==Usage notes==
==Usage notes==
<ul>
<ul>
<li><var>FirstItem</var> is the same as the <var>[[ItemByNumber (GenericNamedArraylist property)|ItemByNumber]]</var> property with a <var class="syntax">number</var> argument of 1.
<li><var>FirstItem</var> is the same as the <var>[[ItemByNumber (GenericNamedArraylist property)|ItemByNumber]]</var> property with a <var class="term">number</var> argument of 1.
<li>The request is cancelled if the <var class="syntax">anyNal</var> collection is empty.
 
<li>The request is cancelled if the <var class="term">anyNal</var> collection is empty.
</ul>
</ul>


==Examples==
 
==See also==
==See also==
The <var>[[LastItem (GenericNamedArraylist property)|LastItem]]</var> property is the last item in the collection.
The <var>[[LastItem (GenericNamedArraylist property)|LastItem]]</var> property is the last item in the collection.
{{Template:GenericNamedArraylist:FirstItem footer}}
{{Template:GenericNamedArraylist:FirstItem footer}}

Latest revision as of 15:03, 15 May 2014

Return or set first item (FloatNamedArraylist, NamedArraylist, and UnicodeNamedArraylist classes)

[Introduced in Sirius Mods 8.1]


Syntax

%currentItem = anyNal:FirstItem anyNal:FirstItem = 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.
newItem A value of the same type as specified on the anyNal declaration to be assigned to the specified anyNal item.

Usage notes

  • FirstItem is the same as the ItemByNumber property with a number argument of 1.
  • The request is cancelled if the anyNal collection is empty.


See also

The LastItem property is the last item in the collection.