I want to let the user of my program to type a math formula into a text box. This formula would be used to modify hundredss of thousands of data records. Records to be modified would be selected based on another formula that would give a true or false result. I envision this as a selection textbox (IF) and a operation textbox (THEN). A simple example of what this might look like is :
IF [ R > S * 1.10 AND T + U < V ] THEN [ R = R + T * G ]
where [ ] denote textboxes and the letters denote fields in the data records. If the first box evaluates to TRUE then the data would be modified according to the formula in the second textbox. Then the next record would be processed.
I have written a program to do this by (1) transforming the formulas to Reverse Polish Notation and then (2) executing the RPN for each record. But step 2 is implemented using an interpretive process and is too slow even on a fast processor, especially when the number of records approaches one million.
My question is: Is it possible in VB6 to generate a machine language fragment of code at run-time and execute it?
(I remember doing something like this decades ago on the TRS-80 microcomputer using BASIC.)
Another possible solution is to pass the formulas to an Excel object which would calculate the results and return them to the VB program. But I suspect this would not be any faster.
I really would like to keep all the processing within VB6 because there a lot of other stuff in the overall process that is best done in VB.
Any ideas?
IF [ R > S * 1.10 AND T + U < V ] THEN [ R = R + T * G ]
where [ ] denote textboxes and the letters denote fields in the data records. If the first box evaluates to TRUE then the data would be modified according to the formula in the second textbox. Then the next record would be processed.
I have written a program to do this by (1) transforming the formulas to Reverse Polish Notation and then (2) executing the RPN for each record. But step 2 is implemented using an interpretive process and is too slow even on a fast processor, especially when the number of records approaches one million.
My question is: Is it possible in VB6 to generate a machine language fragment of code at run-time and execute it?
(I remember doing something like this decades ago on the TRS-80 microcomputer using BASIC.)
Another possible solution is to pass the formulas to an Excel object which would calculate the results and return them to the VB program. But I suspect this would not be any faster.
I really would like to keep all the processing within VB6 because there a lot of other stuff in the overall process that is best done in VB.
Any ideas?