Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating an array of objects - can it be done?
Message
From
26/07/1999 11:33:07
Mark Hall
Independent Developer & Voip Specialist
Keston, Kent, United Kingdom
 
 
To
26/07/1999 11:23:30
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00246094
Message ID:
00246103
Views:
18
>Does anyone know of a way to create, at runtime, an array of the objects which are contained on a form? I'm looking for a function which will run something like this:
>
>laFormObject = AOBJECTS(THISFORM) && pass the name of the form or any other container object (page from a pageframe would be another possibility)
>
>and the resulting array would appear something like this:
>
>laFormObject[1,1] = "lblName" && Object name
>laFormObject[1,2] = "Label" && BaseClass
>laFormObject[1,3] = "m2mLabel" && Class
>
>laFormObject[2,1] = "txtLName" && Object name
>laFormObject[2,2] = "TextBox" && BaseClass
>laFormObject[2,3] = "m2mText" && Class
>
>and so on.
>
>The specific information I need is the object name and the object class, base class, or parent class. Better yet would be a parameter on the function which would only return objects of a particular type or class. I need a list of all of the text boxes and command buttons on a form.
>
>
>Bill Yater
>Made2Manage Systems, Inc.
>Software Development, Windows Application Team

Hi Bill,

Take a look at the code that I posted about five messages ago which give a recursive routine that can be called to process all the objects in all the containers in a form. This could be modified to do what you need.

I have something similar in a system but before VisStudio service pack 3 if the form had an error, all the interconnected objects would make VFP crash. This seems to be much better though after Vis Studio SP3
Regards
Mark

Microsoft VFP MCP
Menulib - OO Menus for VFP www.hidb.com/menulib
Previous
Reply
Map
View

Click here to load this message in the networking platform