Hi Chuck.
The window name is normally something that a compiler (including RB)
throws away when it creates the application.
What you want to do is certainly possible, but perhaps not as
automatic as you would like.
I suggest you look at the possibility of keeping a table or
dictionary in the App object that relates a series of strings (window
names) to a series of pointers to the appropriate window(s).
It would require code in each window to add the correct items to the
tables or dictionary when the window opens, and to remove said
entries as the window closes.
Once you have a pointer to the window, you can determine what kind of
window it is with the IsA() function.
From there you can loop through all the controls of the window,
similarly finding out what each object class is.
Getting data out of a textedit object is reasonably straightforward
with .Text
If you need the name of the control at runtime, you will need to
resort to the same sort of subterfuge that I just described for the
windows, except in this case you can store the appropriate names in
each window, rather than in the App object.
Russ
On Jun 15, 2006, at 12:03 PM, Chuck Pelto wrote:
Greetings All,
I'm interested in developing a module that will allow me to pull
field/item names, types and data from a window based solely on the
window being passed as a param to the method inside the module.
For example:
I have a window that has several textedit fields in it.
I pass the name of the window to this method in the module.
The method:
[1] Determines the objects in the window.
[2] In sequence, determines the nature of each object.
[3] If the object is a textedit object, it gets the name of the
object.
[4] If the object is a textedit object, it gets any data out of the
object.
Is this feasible?
I ask because I'm not seeing any calls in the Window Class of the
Language Ref that looks like they might facilitate this sort of
activity. Where else should I look?
Regards,
Chuck
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>