03-04-2007 02:28 PM
03-04-2007 05:53 PM
@Darren870 wrote:
The problem I am having is its continuously running every time, I only want it to run if the fields are left blank or the area is equal to zero.
What kind of controls are you using for the inputs? Logical would be numeric controls (not e.g. strings).
Use an event structure inside a while loop, triggerend by a value change in the two inputs and recalculate the area whenever one of the inputs changes. (it is probably cheaper to always calculate the area, even if one or both of the inputs are zero. You will simply get an area of zero, which is a correct result.
A normal program never uses the "continuously run" button. If you want the program to stop after the area is no longer zero, do the above and wire the area result to the loop termination via a "not equal zero" node. Typically you would not do that, but instead keep it running as long as you need to calculate areas.