On Jun 19, 2006, at 12:49 PM, Chuck Pelto wrote:
Hi Maarten
On Jun 19, 2006, at 12:33 PM, Maarten de Vries wrote:
There probably is, but it seems a bit like overkill... I would
suggest you
either pass only the data required or the controls containing the
data. I
don't see why you'de have to cycle every control on the window. If
you don't
know the number of the controls/data you need to pass, make the
parameter an
array.
Actually, I think it's better to have a reusable module that takes
ANY window and extracts data from the various elements where data
is stored within than to build the same sort of functionality into
every window of every application.
Yeah...the machines have to do more work, but that beats the heck
out of ME doing more work in writing code.
The question remains, how do I access a control element, such as an
EditField with a Control Class object?
Regards,
Chuck
You can iterate over all the controls in a Window (see ControlCount)
You can test what kind of control it is with IsA
But, every window may not want to use every control for building a
SQL statement.
You might want to create subclasses of the standard controls and have
them implement an interface (say SQLControl) that allows you to set
whether it's used or not instead of having to write code. And you
might have each control return it's value as an appropriately
formated value for a SQL statement (maybe a "SQLString" method in the
interface)
Then you can iterate over all the controls and everyone that IsA
SQLControl you just get the SQLString from it and you ignore all the
other controls
_______________________________________________
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>