What's the difference between !statusOK and !LASTCOMMANDOK?

What’s the difference between !statusOK and !LASTCOMMANDOK ?

Are they equivalent? If so, is one deprecated? Is one preferred?

A question like this must have been answered before. I searched on “!statusOK !LASTCOMMANDOK difference.” Maybe I missed something in the documentation. I’m happy whether you explain here or point me to where this is answered.

1 Like

!statusOK is the new command, and !LASTCOMMANDOK is the old one (deprecated).

The difference is small:

  • !statusOK keeps its status once it is set to false by an error. So to “reset” it, you need to use store | true | !statusOK

  • !LastCommandOK only reports the status of the command directly above when it is used. One line further down, it automatically becomes true again! So you would always need to check it directly below a command. This was quite cumbersome, and (I guess) that is why it was replaced with !statusOK

1 Like

Thank you ulrich. That clarifies for me.