× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Rory Hewitt wrote:
David,

Untested code (but I can't see why it wouldn't work:

P @max B Export
D PI 30P 9
D p1 30P 9 Const
D p2 30P 9 Const
D p3 30P 9 Const Options(*Nopass)
D p4 30P 9 Const Options(*Nopass)
D p5 30P 9 Const Options(*Nopass)
[...]
This allows up to 5 parameters, so you can use it like this:

myvar = @max( var1 : var2 : var3 );

This could be used for any number of values.

myvar - @max( @max(var1 : var2 : var3) : @max(var4 : var5 : var6) );

By extension, you can use @max(x : y) to determine the maximum value of an array with a number of elements that is not known at development time.

max = array(1);
for i = 2 TO elementCount;
max = @max(max : array(i));
endfor;

Personally I prefer Asher's solution, which is both more elegant and more efficient. To each their own.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.