Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Minimum
Message
De
18/06/2014 09:42:43
Mike Yearwood
Toronto, Ontario, Canada
 
 
À
17/06/2014 13:36:16
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01601946
Message ID:
01602035
Vues:
59
>For your ARRAY, whats wrong with ASORT() ?

Good idea!


>>
>>That begs the question what are you doing that for? To go through a list of items of any length and grab the minimum and then have a pointer to the item is a piece of cake.
>>
>>If you have an array with values
>>
>>
DIMENSION laList[2]
>>laList[1]=10
>>laList[2]=20
>>lnMin=laList[1]
>>lnPointer=1
>>FOR X=2 TO ALEN(laList,1)
>>  if laList[m.x] < lnMin
>>    lnMin = laList[m.x]
>>    lnPointer = m.x
>>  endif
>>ENDFOR
>>
>>?"the row with the minimum value is ",m.lnPointer
>>
>>With a cursor
>>
>>
calculate mix(field) to m.lnMin
>>locate for field=m.lnMin
>>lnPointer=recno()
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform