[ Previous entry: Peculiar... ]
[ Next entry: Chess and software development ]
Displaying database index tag names in combo boxes
Here's a simple 2:00AM code I made. Its objective is to make a certain combo box automatically reflect the tag names for the databases you are currently using.
It's too simple really but this was the first time I used this. I even had to refer to Foxpro's help file in the formulation process.
The main purpose is to create a template form for the 'File Utility' type of modules. The term 'File Utility' was something I have acquired from College MacPros (Machine Problems). This is a part of those old DOS based Programs we had back then (created in either Pascal, C/C++, Clipper 5.2) which hold the records for your database-based values, or as one of my clients call it... directories.
This has been a practice which I find useful especially when you're already in the maintenance mode of your program. Directories like this, however, should be planned in advance. The 'Design phase' of your project is a good place to start.
These directories can also be used inside combo boxes, and if in the future you would like to add values that those combo boxes display, you don't need to touch the hard code. You just either edit the database or use your File Utility module.
Very handy too when your database application is being used by more than one client.
Let's give an example.
Suppose you have a combo box for Profession. Of course you can choose the combo box builder wizard and enter the data by hand but that would be lame.
Totally lame that only castrated over-boozed programmers of the 60s do that.
You use a database approach and set the combo box to grab the values of that database.
.cmbProf.rowsource = 'DATABASENAME.FIELDNAME'
... where cmbProf is your Profession combo box and 6 stands for (database) fields, the source of the values the combo box will display.
You can also use the Property box to set things. Other sources include value, alias, sql statement, query (.qpr), array, files, structure, popup, DoomPortal, BermudaTriangle, RiverofLesRough and so on.
Now back to the code above (Darn I'm wandering off once again), the algorithm gets the number of tags the compound index file has, gets the tag names and stores them in an array.
Now using the values in that array, you can place the code below in an object (a 'Browse' command button perhaps).
This will reflect the changes you want to view, which in my case is found in a grid that displays the sorted records.
Disclaimers are for castrated EARTHLINGS.
Powered: GREYMatter | GM-RSS