Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Recursivity in VFP
Message
De
05/04/2001 16:55:11
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Recursivity in VFP
Divers
Thread ID:
00492527
Message ID:
00492527
Vues:
48
Is it possible to use recursivity in VFP?

The following code is a recursive function that doesn't seem to "recurse" right:

FUNCTION follow
LPARAMETERS nPat, nNum
	SEEK nPat
	
	IF FOUND() THEN
		IF couples.id_ph != 0 THEN
			insert_array(nNum, nPat)
			follow(couples.id_ph, nNum)
		ENDIF
		
		IF couples.id_pf != 0 THEN
			insert_array(nNum, nPat)
			follow(couples.id_pf, nNum)
		ENDIF
	ELSE
		RETURN .F.
	ENDIF
	
	RETURN .T.
ENDFUNC
</CODE>
The function is pretty straightforward: It goes through a table and builds an array of all the id's of (married) couples that relate to each other (it's used for building pedigrees and genealogy trees).
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform