**** Find Dependant Tables here select csrTableNames go top scan if selected=.t. thisform.cStatus = 'Assembling tables in the group:' + chr(13) + alltrim(csrTableNames.descrip) + '...' thisform.edtStatus.refresh() = inkey(0.1) thisform.FindRelated(csrTableNames.TableName) endif endscanAnd this is the method code
lparameters pcTableName * Warning! Recursive Function! local i, lRet lRet = seek(pcTableName,'csrTblOrder','TableName') if !csrTblOrder.processed replace processed with .t. in csrTblOrder lRet=mysqlexec("execute dbo.siriussp_RelatedTables "+vfp2sql(pcTableName), 'csrLook', program()) if reccount('csrLook')>0 local array laTables[Reccount('csrLook')] select * from csrLook into array laTables for i = 1 to alen(laTables) thisform.FindRelated(laTables(i)) endfor endif endif returnSo, at the end of that procedure we'll end up with many rows in the cursor (csrTblOrder) to have processed flag set to true. That seems to be the whole point of spending computer's cycles.