Information générale
Catégorie:
Codage, syntaxe et commandes
Suppose you need to get "m" records out of "n".
Depending on whether the order is sufficient or not, you may use expressions:
n!/(n-m)! or n!/(n-m)!/m!
Here factorial n! means n*(n-1)*(n-2)*...*2*1.
Thus you may use the subprogram to calculate factorials, like:
Function iFactorial
LParameter pX
Local retval,ia
retval=1
if pX>1
for ia=1 to pX
retval=retval*ia
endfor
return retval
>I need to do a function or a prg that get the records from one table and in another table create one record for each possible combination of the records of the first table. Each combination of 2 over n, 3 over n, 4 over n...., n over n, where n is the total of records to be combined.
>Some idea? Thanks for any reply.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement