Home » Extra libraries, Code snippets, applications etc. » U++ users applications in progress and useful code snippets, including reference examples! » Please help me make this better
Re: Please help me make this better [message #8565 is a reply to message #8560] |
Sun, 18 March 2007 07:23 |
|
mirek
Messages: 13975 Registered: November 2005
|
Ultimate Member |
|
|
MikeyV wrote on Sat, 17 March 2007 14:53 |
As you can see, it just does the same thing over and over. I was thinking something like this:
void SATS3::Populate (const char *field, const char *table, const char *tab, const char *control) {
SQL*Select(field).From(table);
while(SQL.Fetch())
tab.control.Add(SQL[0]);
}
And then call it like this:
Populate("Code", "Area", "ist", "dEnlType");
Any suggestions?
Mike
|
Yes, that is a good idea. We had it too
tab.control *= Select(Code).From(Generation);
Note that often you will want to fetch pairs (key - name), then
tab.contro *= Select(Key, Code).From(Generation);
Works for DropList and MapConvert.
Mirek
|
|
|
Goto Forum:
Current Time: Tue May 07 11:01:27 CEST 2024
Total time taken to generate the page: 0.02300 seconds
|