Menu

DOS ERRORLEVEL or equivalent

NppExec
JimD
2013-09-09
2013-09-11
  • JimD

    JimD - 2013-09-09

    I can't find anything in the documentation that shows how to capture the result of an external process. I'm hoping that I can have an NPP exec script that can take different actions depending on the return code from a cmd /c process.

    Something like this:

    cmd /c gawk -f script.awk
    if 0 == $(SYS.ERRORLEVEL) goto itWorked
    echo OOPS!
    goto earlyExit
    :itWorked
    ...
    :earlyExit
    

    Of course, ERRORLEVEL isn't an environment variable (it's an internal variable), so this doesn't work.

     
  • DV

    DV - 2013-09-09

    Did you try to type "help" in NppExec's Console?

    :) Sorry, could not resist to ask the most obvious question.

    Seems you are talking about $(EXITCODE) here. This variable has even been used in examples in 3.8.4 of NppExec Manual.

     
  • JimD

    JimD - 2013-09-11

    Thanks! I knew you must have included this somehow...

    Yes, I checked all the documentation--I simply didn't catch EXITCODE. A bad case of reader error!

    I write a lot of documentation for the things I work on so I won't have to answer a lot of questions, but, like you seem to have experienced, I find many people don't read them! :-(

    Thanks for creating and maintaining such a great plug-in!

     

Log in to post a comment.

MongoDB Logo MongoDB