LINKED does not mean here that the forms are linked. It is only linked to the name provided. When you release the named variable, the form also gets released. That is all it means. It is optional.
Since, you are providing a name to the form, you can reference it with that name.
also, all forms are available in the array/collection thingy in _SCREEN.Forms[ n ] ...
To make a general solution, you could search through all the forms by name using:
FOR EACH loFrm in _SCREEN.Forms
wait window loFrm.name
IF loFrm.name="myFormsClassName" ;
or loFrm.Caption="My Form's Caption"
loFrm.propertyname = whatever
ENDIF
ENDFOR
This'll support multiple forms, or if one form just doesn't exist!
your solution using the _screen array is the solution I was looking for. I can't use DO FORM FORM1 NAME oForm1 LINKED
AND DO FORM FORM2 NAME oForm2 LINKED because my app is Codemine based, and this framework has another method of calling forms.
thanks to all who posted, most appreciate your help!
Just revealing what I've learned from a variety of sources, packaged together in one place... I'm really curious if anyone has other methods: The issue of calling one forms PEMs from another form is really fundamental to a VFP application's architecture, since it not only relates to Forms, but ANY objects that you create.
These patterns aren't limited to VFP, either, so it's really an interesting thing to think about and discuss!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.