Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Arrays - finding the max value
Message
De
29/05/2002 13:36:41
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00662347
Message ID:
00662628
Vues:
19
>>>>How to find out the maximum value of the elements in an array?
>>>>Calculate doesnt seem to be working.
>>>>
>>>You have to loop thru all the elements of array.
lnMaxVal = myarray[1]
>>>FOR i=2 TO ALEN(myarray)
>>>  lnMaxVal = MAX(lnMaxVal, myarray[i])
>>>ENDFOR
>>
>>How about ASORT()?
>
>It's too easy. :)

Also, if the order of the array is not the order for the ASORT, you'll end up reordering the array and always pointing to the last element...
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform