Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Find max value in array
Message
De
03/04/2006 07:04:33
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
31/03/2006 12:52:41
Reza Meamar
Homa Programming Group
Shiraz, Iran
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 7 SP1
Database:
Visual FoxPro
Divers
Thread ID:
01109569
Message ID:
01109891
Vues:
20
>>>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform