|
-
May 16th, 2001, 11:51 AM
#1
Boolean string processing
I am working on making a program less specific and more generic. This program loads pictures based on configuration options in a database for each order. These pictures are chosen by a whole series of boolean control statements (if, then, and, or, not) and is currently hard-coded to the application to specific configuration names and pictures.
I have extracted all of the information to a local database for the options and which pictures to load. However to save on time and space I am sticking with the method of picking and choosing the pictures rather than just select every possible combination (3000+). What I have devised is a database that matches field names with field names in the source database. However each of these fields are boolean strings instead of just single options.
For Example:
MDL SHC File
91,98 (V,W);(X,Y) 98 Picture Left.bmp
How this database entry should be read is equivalent to the following:
if (MDL = "91" OR MDL = "98") AND (SHC = "V" OR SHC = "W") AND (SHC = "X" OR SHC = "Y") then
DrawPicture 98 Picture Left.bmp
What I am attempting to do then is write some sort of function to process the boolean algebra as I have shown. I would appreciate any suggestions and or sample code on how to go about processing such boolean statements since I cannot (as far as I know) "build" the exact boolean statement for VB to process.
I was thinking about setting up flags to check if it should be AND vs. OR which I think is the easy part but handling the parentheses may be a bit more difficult.
Thanks in advance for any help.
-K
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|