Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Weird code
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Weird code
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Database:
MS SQL Server
Divers
Thread ID:
01634332
Message ID:
01634332
Vues:
117
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.
If it's not broken, fix it until it is.


My Blog
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform