Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Recursivity in VFP
Message
From
05/04/2001 16:55:11
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Recursivity in VFP
Miscellaneous
Thread ID:
00492527
Message ID:
00492527
Views:
47
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).
Next
Reply
Map
View

Click here to load this message in the networking platform