Useless is a bay on Whidbey Island.
The code marks simply tables that needs to be processed or point to a certain table? It's a bit of a outdated style with superfluous stuff, but who knows how ancient it is? Older then SCAN FOR?
It even checks for cyclics.
I would do similar things for dependecies and the like. Possibly somebody mimics a DBCS for a server (idiot server approach), tries to get structure out of a server, what ever.
>Hi everybody,
>
>I'm trying to figure out the sense of this code.
>
>Here is a call to the method
>
>
>**** 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
> endscan
>
>And 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
>return
>
>So, 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.
>
>Seems to be a pretty useless process to me.
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord
Weeks of programming can save you hours of planning.
OffThere is no place like [::1]