> I want to choose the function by a realname (add, substract), to
> directly see in the main VI what the SubVI does. That means not just
> to use the case-structure inside the VI with just a number defining
> the function to run from the outside.
> 

You have two choices.  You can use a string or enumeration input that is 
wired to a case statement.  In the cases you wire up to different 
functions.  At compile time, LV will compile all of the operations you 
listed, and at runtime it will choose which of the compiled code to jump to.

The second choice is to use an interpretor, like the Evaluate Formula. 
You will need to take the inputs and output and put them into the 
generic format that the Evaluator uses, and you will have to match the 
syntax that it uses.  It doesn't use add, but + for example.

If you want a highly flexible system that lets the user of your 
application type in mathematical expressions, then the interpretor is 
the way to go.  This is just one interpretor, and you can ship the 
expression to DLLs, other math packages, whatever you like.  If you only 
want to select between a few canned math operations, the case is the way 
to go, though hopefully they are higher level than adding and 
subtracting or the UI for picking them will be difficult.

Greg McKaskle


Reply via email to