Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can I get a listing of ControlSources in a form?
Message
From
16/10/2001 13:16:15
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00569049
Message ID:
00569132
Views:
25
This message has been marked as a message which has helped to the initial question of the thread.
>I was wondering if it's possible to get a printout of all the ControlSources used in a form?

Is this design time or run time? If design time you can use ASELOBJ() to get a reference to the form object open in the designer, and then use J. Crescencio's algorithm. Post back here if you need help drilling down into containers, but it's not too difficult. The general idea is have a function you pass an object ref, then the loop goes through the controls collection. If it's a container you pass that object to the same function recursively.

Something like:
*!* MODIFY FORM, then switch to this
CLEAR
DIMENSION Y[1]
x=ASELOBJ(Y,1)

DrillDown(Y)

FUNCTION DrillDown(toO)
	LOCAL o
	FOR EACH o IN toO.OBJECTS
		IF TYPE( 'o.ControlSource' ) = "C"
			?o.name, o.parent.name, o.ControlSource
		ENDIF
		IF PEMSTATUS(O, "OBJECTS", 5)
			DrillDown(o)
		ENDIF
	NEXT o
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform