Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Menu executing form methods and objects
Message
 
À
05/07/2010 18:51:31
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP1
Divers
Thread ID:
01471439
Message ID:
01471491
Vues:
45
Doyle,

In your menu you could add:
lparameters toParentForm
local loParentForm

loParentForm = iif(vartype(toParentForm) = 'O' and pemstatus(toParentForm, 'imgABC', 5) and pemstatus(toParentForm, 'imgXYZ', 5), toParentForm, .null.)
then when you want use them:
* note that from now on I do not use toParentForm any longer but loParentForm instead
if not isnull(loParentForm)
	loParentForm.imgABC.Visible = .t.
	loParentForm.imgXYZ.Visible = .t.
endif
Now, it might be better if instead of using the long list of pemstatus you might need (for example it seems you have lot of images, and even then pemstatus might not be enough, as imgXYZ might be defined but is not an object or is an object of a class that do not have the interface you expect) you could use the name of the form and then check that are is one of the allowed forms, or better, you only perform the calls if the class of the form is a determined one.

then
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform