Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Find max value in array
Message
From
03/04/2006 07:04:33
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
31/03/2006 12:52:41
Reza Meamar
Homa Programming Group
Shiraz, Iran
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:
01109891
Views:
19
>>>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
>
>Thanks dear Cetin
>I know about ASORT() but i dont understand it.
>Can you explain you code for me?
>Thanks again
acopy(myArray,aTemp) && Copy to another array - so original one is not touched in any way
asort(aTemp,2,-1,1) && Sort aTemp array's 2nd column in descending order 
luMax = aTemp[2] && First element of 2nd column is that column's max
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform