CASE and ABORT
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:
2: if anotherVariable <> BadCondtion 'do some stuff herePUB Main repeat case myVal 1: if(anotherVariable == BadCondition) myVal := 2 ' change myVal to 2 but don't change to the next case "2" until other code has run below CASE NEXT ??? ' do some stuff including check external IC data, and other time consuming processes 2: if(anotherVariable == BadCondition) myVal := 3 ' change myVal to 3 but don't change to the next case "3" until other code has run below CASE NEXT ??? ' do some stuff including check external IC data, and other time consuming processes 3: if(anotherVariable == BadCondition) myVal := 4 ' change myVal to 4 but don't change to the next case "4" until other code has run below CASE NEXT ??? ' do some stuff including check external IC data, and other time consuming processes 4: ' do some stuff ' start processing here if case is finished or "aborted". outa[myPin] := new_state process_change(myVal) ' This MUST run before the CASE changes to the next numberswitch (myVal) { case '1': <do stuff> break; case '2': <do other stuff> break; . . . case '5': <do something else> break; default: <do this if no case match. break; }Each BREAK will skip to the end of the code block.
This is for C, I did not realize you were doing SPIN
n := 1 case n 1: FDS.str(string("1")) 1,2: FDS.str(string("12")) 1,2,3: FDS.str(string("123")) 1,2,3,4: FDS.str(string("1234"))Even though a 1 is a match for all four cases, only the first one gets executed.and put everything billow that needs to be aborted in the else.
The else block will execute if ok so far.