tamm Posted October 14, 2013 Share Posted October 14, 2013 I am creating a sequence (for calibration of sensors) which contains a number of dialogs (MessageBox) where the user shall be able to quit the calibration. Is there any way to exit the sequence prematurely? I know I can achieve the same thing by using if constructs, but since there are several places where I want to offer to quit the sequence, this would result in a number of nested if's which then gets a bit confusing. See my examples below: if (System.MessageBox("..."))=="Yes") some code (1) if (System.MessageBox("..."))=="Yes") some code (2) if (System.MessageBox("..."))=="Yes") some code (3) endif endif endif Instead, I would like something like this: if (System.MessageBox("..."))!="Yes") exit endif some code (1) if (System.MessageBox("..."))!="Yes") exit endif some code (2) if (System.MessageBox("..."))!="Yes") exit endif some code (3) sd Is this possible? Link to comment Share on other sites More sharing options...
AzeoTech Posted October 14, 2013 Share Posted October 14, 2013 Sure, just use return: if (system.messageBox(....) != "Yes") return endif Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.