CompileErrors/C2002
C2002 - Multiple ELSE statements in IF block.
Description
C2002 is issued when multiple ELSE statements are found at the same tab level of an open IF block.
If unaddressed in the prog, GibbsCAM will execute the code from the first ELSE block, skipping the code from the other ELSE blocks entirely.
Example of Cause
An IF block followed by multiple ELSE statements.
IF FirstOperation?
IF (ToolGroup# == 1)
...
ELSE
{ prog code in here gets executed if the IF statement is false }
ELSE { Offending ELSE statement }
{ prog code in here never gets executed }
END
END
Resolution
The resolution can vary.
If the error is encountered while compiling a legacy PST file, then preserving legacy behavior is most likely the best course of action. In this case, the body of the first ELSE block is what GibbsCAM uses at runtime and should be the code that is preserved in the prog.
Otherwise the resolution should be to correct the post such that the post developer's intended behavior persists.