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).