Number (FloatNamedArraylist function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
 
(17 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<span style="font-size:120%; color:black"><b><section begin=dpl_desc/>Item number of specified item<section end=dpl_desc/></b></span>
{{Template:FloatNamedArraylist:Number subtitle}}
[[Category:FloatNamedArraylist methods|Number property]]
 
<!--DPL?? Category:FloatNamedArraylist methods|Number property: Item number of specified item-->
<var>Number</var> returns the item number (ordinal) of the item that has the specified subscript in the <var>FloatNamedArraylist</var>.
<p>
 
Number is a member of the [[FloatNamedArraylist class]].
==Syntax==
{{Template:FloatNamedArraylist:Number syntax}}
===Syntax terms===
<table class="syntaxTable">
<tr><th>%number</th>
<td>A numeric variable to contain the item number of the <var class="term">fltNal</var> item selected by <var class="term">subscript</var>.</td></tr>
<tr><th>fltNal</th>
<td>A <var>FloatNamedArraylist</var> object. </td></tr>
<tr><th>subscript</th>
<td>A numeric value that serves as a subscript to identify a <var class="term">fltNal</var> item.</td></tr>
</table>
 
==Usage notes==
<ul>
<li>If <var>Number</var> is called and there is no item on the <var>FloatNamedArraylist</var> that has the indicated <var class="term">subscript</var>, a <code>0</code> is returned, regardless of the setting of <var>[[UseDefault (FloatNamedArraylist property)|UseDefault]]</var>.
</ul>
 
==Examples==
 
<p class="code">b
%y  is collection floatNamedArraylist of string len 32
%i  is float
%y = new
%y(7) = 'seven'
%y(38) = 'thirty-eight'
%y(110) = 'one-hundred-ten'
%i = 38
print  %y:number(%y:nameByNumber(%i)) and %y:nameByNumber(%i) and %y:itemByNumber(%i)
end for
end
</p>
</p>
The request prints:
<p class="output">


This ReadOnly property returns the item number (ordinal) of the item that has the
2 38 thirty-eight
specified subscript in the FloatNamedArraylist.
==Syntax==
<p class="code">%num = %fnamrayl:Number(subscript)
</p>
</p>
===Syntax Terms===
<dl>
<dt><i>%num</i>
<dd>A numeric variable to contain the item number of the
specified ''%fnamrayl'' item.
<dt><i>%fnamrayl</i>
<dd>A FloatNamedArraylist object.
<dt><i>subscript</i>
<dd>A numeric value
that serves as a subscript to identify a ''%fnamrayl'' item.


</dl>
==See also==
==Usage Notes==
<ul>
<ul>
<li>If the Number property is called and there is no item
<li>The <var>[[ItemByNumber_(GenericNamedArraylist_property)|ItemByNumber]]</var> property lets you retrieve or set an item using the item's ordinal number.
on the FloatNamedArraylist that has the indicated subscript,
<li>The <var>[[NameByNumber (FloatNamedArraylist function)|NameByNumber]]</var> function lets you retrieve an item's name using the item's ordinal number.
a <tt>0</tt> is returned,
regardless of the setting of [[UseDefault (FloatNamedArraylist property)|UseDefault]].
</ul>
</ul>
{{Template:FloatNamedArraylist:Number footer}}

Latest revision as of 15:22, 23 September 2020

Item number of specified name (FloatNamedArraylist class)


Number returns the item number (ordinal) of the item that has the specified subscript in the FloatNamedArraylist.

Syntax

%number = fltNal:Number( subscript)

Syntax terms

%number A numeric variable to contain the item number of the fltNal item selected by subscript.
fltNal A FloatNamedArraylist object.
subscript A numeric value that serves as a subscript to identify a fltNal item.

Usage notes

  • If Number is called and there is no item on the FloatNamedArraylist that has the indicated subscript, a 0 is returned, regardless of the setting of UseDefault.

Examples

b %y is collection floatNamedArraylist of string len 32 %i is float %y = new %y(7) = 'seven' %y(38) = 'thirty-eight' %y(110) = 'one-hundred-ten' %i = 38 print %y:number(%y:nameByNumber(%i)) and %y:nameByNumber(%i) and %y:itemByNumber(%i) end for end

The request prints:

2 38 thirty-eight

See also

  • The ItemByNumber property lets you retrieve or set an item using the item's ordinal number.
  • The NameByNumber function lets you retrieve an item's name using the item's ordinal number.