Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Menu executing form methods and objects
Message
 
To
05/07/2010 18:51:31
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP1
Miscellaneous
Thread ID:
01471439
Message ID:
01471491
Views:
43
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
Previous
Reply
Map
View

Click here to load this message in the networking platform