Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Find max value in array
Message
From
01/04/2006 05:28:07
 
 
To
31/03/2006 12:35:20
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 7 SP1
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01109569
Message ID:
01109739
Views:
13
Hi Reza,


if you add a few lines your code can show mor visible results:
CLEAR 
x=ADIR(la1,[*.*])
ncol=4
acopy(la1,aTemp)
asort(la1,ncol,-1,1)
luMax = la1[2]

FOR I= 1 TO x
?la1[i,ncol]
endfor
run this prg with different values for ncol. (ncol is the column number to sort by)
hope this helps

Peter





>>Hi all,
>>I have an array MyArray(100,5)
>>I want to search for maximum value in column 2 in MyArray
>>What is the best way to do this?
>>Thanks for your help
>
>acopy(myArray,aTemp)
>asort(aTemp,2,-1,1)
>luMax = aTemp[2]
>
Cetin
Peter Cortiel
Previous
Reply
Map
View

Click here to load this message in the networking platform