FUNCTION aFindMax( xArray ) // xArray should be your array
LOCAL aVals := {; //just for testing
{ 0, 45, 29, 97, 472, 265, 127, 3, 123, 24, 11, 55 },;
{ 0, 66, 104, 298, 79, 47, 12, 12, 90, 48, 130, 155 },;
{ 0, 158, 7, 7, 95, 169, 86, 230, 148, 79, 446, 20 },;
{ 0, 11, 17, 131, 422, 50, 204, 37, 5, 11, 48, 433 },;
{ 0, 52, 6, 49, 312, 58, 128, 108, 284, 248, 92, 373 },;
{ 0, 33, 30, 440, 451, 77, 60, 70, 227, 440, 31, 25 },;
{ 0, 70, 134, 5, 60, 55, 11, 347, 22, 28, 549, 66 },;
{ 0, 259, 58, 30, 18, 57, 91, 27, 126, 65, 78, 176 },;
{ 0, 107, 42, 118, 94, 37, 49, 23, 623, 22, 19, 79 } ;
}
LOCAL nRows := len( aVals )
LOCAL nCols := len( aVals[1] )
LOCAL nR, nC
LOCAL nRmax := 0, nCmax := 0
LOCAL nMax := 0
for nR := 1 to nRows
for nC := 2 to nCols
if aVals[nR, nC] > nMax
nMax := aVals[nR, nC]
nRmax := nR
nCmax := nC
endif
next
next
msginfo( nRmax ) //just for testing
msginfo( nCmax ) //just for testing
RETURN ( { nRmax, nCmax } ) // Returns array with row and col numbers of maximum