Passing in an expression


New member
Jun 7, 2004
Programming Experience
Hello. I have an application that I need to pass in an expression to from an external source (database).
I have a value that needs to be tested via this external expression and I just want to return a boolean value based on the outcome. I have a good grasp on everything needed except how to take an expression in a string and evaluate that exoression in code at runtime.

For example, I have a int16 called iTally. I have an expression I grabed from a database assigned to a string variable called that strExp and the value is ">=2". So I'd like to be able to test if iTally >=2 (in this case, of course the expression is variable). I found one code sample of a fairly complicated way to take vb code in a string and compile and execute it. I'm hoping I can avoid that in this simple scenario. Could I somehow use a dataview or similar mechanism to do this? Any hints, ideas, or links would be greatly appreciated!