Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous messageGo to previous message
mirek is currently offline  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 Smile

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
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Scribble examples compiling and other errors
Next Topic: Using dual-screen
Goto Forum:
  


Current Time: Tue May 07 11:01:27 CEST 2024

Total time taken to generate the page: 0.02300 seconds