CASE and ABORT
eagletalontim
Posts: 1,399
I am not finding much information about the CASE statement and was wondering if using ABORT will "break" out of the CASE and process lines past it. Example below :
case myVal 1: ' do some stuff 2: if(anotherVariable == BadCondition) ABORT ' do some stuff here 3: ' and do some other stuff here ' start processing here if case is finished or "aborted" outa[myPin] := new_state
Comments
Since my case is in the "MAIN" loop, I don't want it to quit the REPEAT. Will using the QUIT command in a CASE only leave the CASE and continue the REPEAT?
QUIT can only be used within a repeat, and will exit the repeat loop.
You could use NEXT if you want to skip the rest of the loop, and execute the next loop iteration.
What you should do is this:
Each BREAK will skip to the end of the code block.
This is for C, I did not realize you were doing SPIN
and put everything billow that needs to be aborted in the else.
The else block will execute if ok so far.