You could also place the values in an array, sort it, and pick the first
for min and last for max (assuming the array size is the same as the number
of values you want the max of).
e.g, if you wanted the max of {-1, 16, 25}, and the array was actually four
elements long, you would have to sort only the first three elements, and
select element 3 after the sort. Otherwise, if you sorted the whole array,
the sort would result in
-1
0
16
25
whereas sorting (1, 16, 25} would result in
0
1
16
25
and sorting (-1, -16, -25} would result in
-25
-16
-1
0
Use BIF %SORTA() to sort only the number of values you want the min and max
of, and then
array(1) will be the min and array (numberOfvalues) will be the max.
In a message dated 4/22/2009 6:13:44 P.M. Jerusalem Daylight Time,
coteijgeler@xxxxxxxxx writes:
If you have not searched the manuals (i.e. the Index of the RPG Reference),
you should have first, but no, you have to write your own.
If the values come from a PF (table), use SQL and the MIN/MAX-functions.
With regards,
Carel Teijgeler
*********** REPLY SEPARATOR ***********
On 22-4-2009 at 16:21 David FOXWELL wrote:
Given 2 or more values, is there a BIF or something in RPG that will
return the highest of those values?
As an Amazon Associate we earn from qualifying purchases.