Minimum (UnicodeNamedArraylist function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
m (1 revision)
Line 13: Line 13:
{{Template:UnicodeNamedArraylist:Minimum syntax}}
{{Template:UnicodeNamedArraylist:Minimum syntax}}
===Syntax terms===
===Syntax terms===
<dl>
<table class="syntaxTable">
<dt><i>name</i>
<tr><th><i>name</i></th>
<dd>A Unicode string to contain the subscript name of the
<td>A Unicode string to contain the subscript name of the item in the indicated UnicodeNamedArraylist that has the minimum value after the argument function has been applied. </td></tr>
item in the indicated UnicodeNamedArraylist that has the minimum value
<tr><th><i>%unamrayl</i></th>
after the argument function has been applied.
<td>A UnicodeNamedArraylist object. </td></tr>
<dt><i>%unamrayl</i>
<tr><th><i>function</i></th>
<dd>A UnicodeNamedArraylist object.
<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 ''%unamrayl'' declaration and that returns a numeric or string value.
<dt><i>function</i>
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>
<dd>A method value (a method name literal, a method variable,
</table>
or even a method that returns a method value) for a method
that operates on objects of the type specified on the ''%unamrayl''
declaration and that returns a numeric or string value.
 
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]].
 
</dl>
==Usage notes==
==Usage notes==
<ul>
<ul>

Revision as of 23:09, 31 January 2011

Name of item with minimum value or minimum value of function applied to items (UnicodeNamedArraylist class)


This function returns the name (subscript) of the UnicodeNamedArraylist item that has the minimum value after the application of a specified function to each item. The function that gets applied to each UnicodeNamedArraylist item, which you identify in the argument to Minimum, 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". Local methods are discussed in ?? refid=localm..

Syntax

%unicode = uniNal:Minimum[( [itemFunction])]

Syntax terms

name A Unicode string to contain the subscript name of the item in the indicated UnicodeNamedArraylist that has the minimum value after the argument function has been applied.
%unamrayl A UnicodeNamedArraylist object.
function 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 %unamrayl declaration and that returns a numeric or string value. The special identity function, This, is the default function value for the Maximum and Minimum methods. See Using the This function as the Maximum parameter.

Usage notes

  • If the function applied by Minimum returns string values, Minimum uses the decimal-equivalent value of the character bytes and determines the number of the item that has the lowest value. Therefore, lowercase letters are ranked alphabetically and the minimum lowercase letter is "a"; the uppercase letters are ranked alphabetically and the minimum uppercase letter is "A"; "z" ranks lower than all the uppercase letters; and all letters rank lower than any number.
  • If one or more UnicodeNamedArraylist items have equal, minimum, values, Minimum returns the subscript of the item that appears closest to the beginning of the UnicodeNamedArraylist.
  • The Maximum function is the opposite of the Minimum function.
  • The parameter for Minimum 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 Minimum parameter. Example "Maximum/Minimum with local method" shows a way to apply ToIntegerPower with Maximum or Minimum for an Arraylist.

See also