Maximum (FloatNamedArraylist function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
m (match syntax table to diagram, tags and edits)
Line 1: Line 1:
{{Template:FloatNamedArraylist:Maximum subtitle}}
{{Template:FloatNamedArraylist:Maximum subtitle}}


This function returns the number (subscript) of the FloatNamedArraylist item
<var>Maximum</var> returns the number (subscript) of the <var>FloatNamedArraylist</var> item that has the maximum value after the application of a specified function to each item. The function that gets applied to each <var>FloatNamedArraylist</var> item, which you select with the required <var class="term">itemFunction</var> argument, must be a method that operates on the item type and returns a User Language [[Intrinsic classes|intrinsic]] datatype (<var>Float</var>, <var>String</var>, <var>Longstring</var>, or <var>Unicode</var>) value.
that has the maximum value after the application of a specified function to
each item.
The function that gets applied to each FloatNamedArraylist item, which
you identify in the argument to Maximum, must be a method
that operates on the item type and returns a User Language intrinsic
datatype (Float, String, Longstring, or Unicode) value.


The system intrinsic classes are discussed in [[Intrinsic classes|"Intrinsic classes"]].
Local methods are discussed in [[??]] refid=localm..


Maximum is available in ''Sirius Mods'' version 7.3 and later.
==Syntax==
==Syntax==
{{Template:FloatNamedArraylist:Maximum syntax}}
{{Template:FloatNamedArraylist:Maximum syntax}}
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%num</th>
<tr><th>%number</th>
<td>A numeric variable to contain the subscript number of the item in the indicated FloatNamedArraylist that has the maximum value after the argument function has been applied. </td></tr>
<td>A numeric variable to contain the subscript number of the item in the indicated <var>FloatNamedArraylist</var> that has the maximum value after the argument function has been applied.</td></tr>
<tr><th>%fnamrayl</th>
<tr><th>%fntNal</th>
<td>A FloatNamedArraylist object. </td></tr>
<td>A <var>FloatNamedArraylist</var> object.</td></tr>
<tr><th>function</th>
<tr><th>itemFunction</th>
<td>A method value (a method name literal, a method variable, or even a method that returns a method value) for a method that operates on objects of the type specified on the ''%fnamrayl'' declaration and that returns a numeric or string value.
<td>A method value (a method name literal, a method variable, or even a method that returns a method value) for a method that operates on objects of the type specified on the <var class="term">fltNal</var> declaration and that returns a numeric or string value.
 
<p>As of <var class="Product">"Sirius Mods"</var> Version 7.6, the special identity function, <var>This</var>, is the default <var class="term">itemFunction</var> value for the Maximum and Minimum methods. See [[Collections#Using the This function as the Maximum parameter|"Using the This function as the Maximum parameter"]] for more information.</p></td></tr>
As of ''Sirius Mods'' version 7.6, the special identity function, <tt>This</tt>, is the default ''function'' value for the Maximum and Minimum methods. See [[Collections#Using the This function as the Maximum parameter|"Using the This function as the Maximum parameter"]].</td></tr>


</table>
</table>
==Usage notes==
==Usage notes==
<ul>
<ul><li>If the function applied by <var>Maximum</var> returns string values, <var>Maximum</var> uses the decimal-equivalent value of the character bytes and determines the number of the item that has the greatest value. Lowercase letters are first ranked alphabetically; then uppercase letters, also ranked alphabetically; finally followed by the numbers; that is: <code>'a'..'z','A'..'Z',0..9</code>.
<li>If the function applied by Maximum returns string values, Maximum
<li>If two or more <var>FloatNamedArraylist</var> items have equal, maximum, values, <var>Maximum</var> returns the position of the item that appears closest to the beginning of the <var>FloatNamedArraylist</var>.
uses the decimal-equivalent value of the character bytes and determines
<li>The parameter for <var>Maximum</var> is a method value, not a User Language expression. That is, you cannot provide a function that itself has an argument (say, <var>[[ToIntegerPower and ToPower (Float functions)|ToIntegerPower]]</var>(2)) as the <var>Maximum</var> parameter. The [[#Maximum and Minimum with local method|"Maximum and Minimum with local method"]] example shows a way to apply <var>[[ToIntegerPower and ToPower (Float functions)|ToIntegerPower]]</var> with <var>Maximum</var>.
the number of the item that has the greatest value.
<li><var>Maximum</var> is available in <var class="product">[[Sirius Mods|"Sirius Mods"]]</var> Version 7.3 and later.
Therefore, lowercase letters are ranked alphabetically and
the maximum lowercase letter is "z";
the uppercase letters are ranked alphabetically and
the maximum uppercase letter is "Z";
"z" ranks lower than all the uppercase letters;
and all letters rank lower than any number.
<li>If two or more FloatNamedArraylist items have equal, maximum, values,
Maximum returns the subscript of the item that appears closest to the beginning
of the FloatNamedArraylist.
<li>The parameter for Maximum is a method value, not a User Language expression.
That is, you cannot provide a function that itself has an argument
(say, <tt>ToIntegerPower(2)</tt>) as the Maximum parameter.
Example [[Maximum (Arraylist function)|"Maximum/Minimum with local method"]] shows a way to apply ToIntegerPower
with Maximum for an Arraylist.
<li>The [[Minimum (FloatNamedArraylist function)|Minimum]] function is the opposite of the Maximum function.
<li>For examples of Maximum (and Minimum) calls, see the [[Minimum (FloatNamedArraylist function)#Examples|FloatNamedArraylist Minimum function example]] in
the Minimum method description, and see [[Collections#Finding collection maxima and minima, and sorting|"Finding collection maxima and minima, and sorting"]].
</ul>
</ul>
==Examples==
<ol><li>For examples of <var>Maximum</var>(and <var>Minimum</var>) calls, see the [[Minimum (FloatNamedArraylist function)#Examples|"FloatNamedArraylist Minimum function example"]] in
the <var>Minimum</var> method description, and [[Collections#Finding collection maxima and minima, and sorting|"Finding collection maxima and minima, and sorting"]].</ol>
==See also==
==See also==
<ul><li><var>[[Minimum_(FloatNamedArraylist_function)|Minimum]]</var> is the opposite of the Maximum function.</ul>
{{Template:FloatNamedArraylist:Maximum footer}}
{{Template:FloatNamedArraylist:Maximum footer}}

Revision as of 10:05, 8 March 2011

Name of item with maximum value or maximum value of function applied to items (FloatNamedArraylist class)


Maximum returns the number (subscript) of the FloatNamedArraylist item that has the maximum value after the application of a specified function to each item. The function that gets applied to each FloatNamedArraylist item, which you select with the required itemFunction argument, must be a method that operates on the item type and returns a User Language intrinsic datatype (Float, String, Longstring, or Unicode) value.


Syntax

%number = fltNal:Maximum[( [itemFunction])]

Syntax terms

%number A numeric variable to contain the subscript number of the item in the indicated FloatNamedArraylist that has the maximum value after the argument function has been applied.
%fntNal A FloatNamedArraylist object.
itemFunction A method value (a method name literal, a method variable, or even a method that returns a method value) for a method that operates on objects of the type specified on the fltNal declaration and that returns a numeric or string value.

As of "Sirius Mods" Version 7.6, the special identity function, This, is the default itemFunction value for the Maximum and Minimum methods. See "Using the This function as the Maximum parameter" for more information.

Usage notes

  • If the function applied by Maximum returns string values, Maximum uses the decimal-equivalent value of the character bytes and determines the number of the item that has the greatest value. Lowercase letters are first ranked alphabetically; then uppercase letters, also ranked alphabetically; finally followed by the numbers; that is: 'a'..'z','A'..'Z',0..9.
  • If two or more FloatNamedArraylist items have equal, maximum, values, Maximum returns the position of the item that appears closest to the beginning of the FloatNamedArraylist.
  • The parameter for Maximum is a method value, not a User Language expression. That is, you cannot provide a function that itself has an argument (say, ToIntegerPower(2)) as the Maximum parameter. The "Maximum and Minimum with local method" example shows a way to apply ToIntegerPower with Maximum.
  • Maximum is available in "Sirius Mods" Version 7.3 and later.

Examples

  1. For examples of Maximum(and Minimum) calls, see the "FloatNamedArraylist Minimum function example" in the Minimum method description, and "Finding collection maxima and minima, and sorting".

See also

  • Minimum is the opposite of the Maximum function.