Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Avg function
Message
 
 
À
27/06/2005 09:58:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01026694
Message ID:
01026724
Vues:
15
Chaim,

If you are averaging less than the max number of parameters to a function there's no need to bother with a cursor:
* only 15 shown for brevity...
function AvgValues( p01, p02, p03, p04, p05, p06, p07, p08, p09, p10, p11, p12, p13, p14, p15 )

local lnSum, i
lnSum = 0
for i = 1 to pcount()
   lnSum = lnSum + eval( "p" + padl( i, 2, "0" ) )
endfor

return lnSum / pcount()
>Help please
>How can I get variables/properties average?
>The function avg() give me the average only from table\cursors.
>I can't run:
avg(3,5)
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform