Number (FloatNamedArraylist function): Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
(5 intermediate revisions by the same user not shown) | |||
Line 21: | Line 21: | ||
==Examples== | ==Examples== | ||
<p class="code">b | <p class="code">b | ||
%y is collection floatNamedArraylist of string len 32 | %y is collection floatNamedArraylist of string len 32 | ||
%i is float | %i is float | ||
%y = new | %y = new | ||
Line 39: | Line 32: | ||
%y(110) = 'one-hundred-ten' | %y(110) = 'one-hundred-ten' | ||
%i = 38 | |||
print %y:number(%y:nameByNumber(%i)) and %y:nameByNumber(%i) and %y:itemByNumber(%i) | |||
end for | end for | ||
Line 52: | Line 41: | ||
The request prints: | The request prints: | ||
<p class="output"> | <p class="output"> | ||
38 thirty-eight | 2 38 thirty-eight | ||
</p> | </p> | ||
==See also== | ==See also== |
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.