Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Obtaining all Objects and Control Sources
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00467812
Message ID:
00467867
Vues:
12
>Hi!
>
>I don't know if it already exists, but it is not a problem to write such program, I can do this quite quickly. The idea is to scan all SCX files opened as tables and search properties field for 'ControlSource' substring. The complexity here is depended on what exactly you want to scan: All ControlSource values (simple) or with exceptions, say, do not include grid controls and read-only/disabled controls etc.; filter to some control type only, for example, you can have custom image control with control source property, but it is not worth to include into your list in dbf.
>
>
>>Is there a way of pulling out all the (data related) objects and their control sources in a single project? I want to build a table that contains the names/control sources etc. of all the objects.
>>
>>Thanks
>>Kev

There are two other methods to achieve the same functionality:
1) Just navigate through form controls and check, if type("loControl.ControlSource")="C", etc.

2) You the idea, I got from Trey Walpole, e.g.
Form.SetAll('lRetrieveSource',.t.)

Add property lRetrieveSource to the classes, you want to retrieve source.
Add method RetrieveSource with the needed code.
Add assign method to this property with the following code:
lparameters vNewVal
*To do: Modify this routine for the Assign method
with this
	.lRetrieveSource = m.vNewVal
	if m.vNewVal 
		.RetrieveSource()
	endif
endwith
May be this is not efficient for this particular task, but you can use this idea for something else. I really like this idea (if you want to execute some code for all your objects you can add some property to this object and give it assign method).

HTH
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform