Menu

Stop (exit, quit) a script early

Help
Ron Jensen
2016-01-20
2016-01-21
  • Ron Jensen

    Ron Jensen - 2016-01-20

    I have some logic I'm working on that should end a script if a condition is not met. I tried:

    if (type(startPos) == NoneType):
     sys.exit("Next Sheet Not Found")
    

    But that causes Notepad++ to exit. Not the desired behavior! Is there a way to end the script without exiting NPP?

    Thanks

     
  • CFrank

    CFrank - 2016-01-20

    What I do is making a main function out of the main part and using return instead.

    Cheers
    Claudia

     
  • Ron Jensen

    Ron Jensen - 2016-01-21

    That will work, thank you.

     

Log in to post a comment.