Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Weird code
Message
From
05/04/2016 13:12:09
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Database:
MS SQL Server
Miscellaneous
Thread ID:
01634332
Message ID:
01634334
Views:
73
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.

Off

There is no place like [::1]
Previous
Reply
Map
View

Click here to load this message in the networking platform