Array question ?

 

I have 5 Arrays....

USD[n],EUR[n],JPY[n],GBP[n],CHF[n];

Each is value is standardized to a value between 100 and -100

What i want to get is the Max and MIN value for [n] across all 5 arrays.

for example: n = 12

USD[12] = 95

EUR[12] = 80

JPY[12] = 25

GBP[12] = 12

CHF[12] = 20

How do I Get the max/min value and max/min array. . . in this case would be

Max: Currency = "USD", Value = 95;

Min : Currency = "GBP", Value = 12;

I figured out how to return the Max and min value but cannot figure out how to determine which array that value corresponds to.....

Thanks,

KK

 

Maybe use the following declarations

string names[] = { "USD", "EUR", "JPY", "GBP", "CHF" };

double array[5];

void setArray(int index)

{

array[0] = USD[ index ];

array[1] = EUR[ index ];

array[2] = JPY[ index ];

array[3] = GBP[ index ];

array[4] = CHF[ index ];

}

[/PHP]

Then call setArray before the comment...

[PHP]setArray( 12 );

Comment( "Min: " + names[ ArrayMinimum( array ) ] + ": " + ArrayMinimum( array ) ...

Reason: