LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I setup a conditional exit from an event

A part of my app requires an operator to enter string information then SAVE this information to a file. The SAVE boolean triggers an event that writes the string information as well as several test parameters to the file.

I want to compare the entered string information against what I expect prior to opening the file and saving the data.

If the string information is incorrect I want to display a dialog and exit the event immediately.

I know how to do the comparison and the dialog, but have yet to figure out how to prematurely exit an event. I would appreciate an example of how to do this.

Thanks in advance for your input.

todd
0 Kudos
Message 1 of 3
(2,900 Views)
You cannot prematurely exit the event. However, you could include a case statement inside the event. Make your comparison inside the event and wire this to the case statement. In the case that the comparison is TRUE then you would open the file and save the data. In the case that the comparison is FALSE you would run the dialog. While this approach does not exit the event prematurely, it does accomplish the goal of exiting the event without running your save routines. I have attached an example which should illustrate this approach.
Message 2 of 3
(2,900 Views)
Thank you John,

This is my first LabView application and I still haven't made the mindset change from VB.

Appreciate the input.

todd
0 Kudos
Message 3 of 3
(2,900 Views)