title: What is the code to exit/ stop VBscript from running in the event of a condition not being met?
body: <p>I have looked on Google and the answer is not there! </p>
  
  <p>First things first. WScript.Quit DOES NOT WORK! I have no idea what "WScript" is but it clearly has nothing to do with client side scripting for a web page. I have seen this "WScript" thing somewhere before and it just produces errors (maybe obsolete or something) so please do not suggest it...</p>
  
  <p>Anyway... all I wish to do is completely stop the script in the event of a condition not being met. Obviously I don't want "Exit Sub" because the code would then carry on running if that sub is embedded!</p>
  
  <p>I am aware of the "stop" command but I am under the impression that it is only used for debugging. </p>
  
  <p>Hopefully a very simple question.</p>
  
  <p>UPDATE and Conclusion: Before I close this subject I will just expand a little on what I was trying to do...</p>
  
  <p>I had a number of main subs that were being started by a button click. In order to make it so that I did not have to edit each individual sub I embedded a universal sub within each one that did a preliminary check. </p>
  
  <p>Part of that preliminary check was to stop the program in the case of an incorrect user input. If an error was detected I wanted to halt all progress from that point on. An "exit sub" would obviously just skip the rest of that preliminary sub and the main sub would carry on executing. </p>
  
  <p>In the end it was just a case of writing in an error flag (that is checked in the main subs) or incorporating the error condition operation in each main procedure. In that way you exit the main sub and the problem is solved. </p>
  
  <p>It was not laziness - I just wanted to reduce the amount of code. Thank you for the responses anyway.  </p>