Basic Syntax: When a Case Selection Construct is encountered during the program's execution, the test expression specified by <expression> is evaluated once, and the result of that evaluation is compared to the values specified by the <expressionlist...> elements for each Case keyword encountered in the structure. If there is a match, then the program flow skips to and executes the statements specified by the <statement...> element associated with that case's expression. Once the statements have been executed, the program flow skips to the statement following the Case Selection Construct at which point the program's execution resumes. If more than one of the case expressions matches the test expression then only the statements associated with the first matching case expression will be executed. If none of the case expressions matches the test expression then the program flow skips to the statement following the Case Selection Construct at which point the program's execution resumes, unless the optional CASE ELSE keywords are encountered in the structure, in which case, the program flow skips to and executes the statements specified by the <statementsD> element. and then skips to the statement following the Case Selection Construct. C and Java Syntax: When a Case Selection Construct is encountered during the program's execution, the test expression specified by <expression> is evaluated once, and the result of that evaluation is compared to the values specified by the <expressionlist...> elements for each Case keyword encountered in the structure. If there is a match, then the program flow skips to and executes the statements specified by the <statement...> element associated with that case's expression. Once the statements have been executed, the program flow executes all of the following case's statements as well, unless the optional break keyword is encountered, in which case, the program flow skips to the statement following the Case Selection Construct at which point the program's execution resumes. If more than one of the case expressions matches the test expression then the program flow skips to the first matching case statements and begins executed at that point. If none of the case expressions matches the test expression then the program flow skips to the statement following the Case Selection Construct at which point the program's execution resumes, unless the optional default keyword is encountered in the structure, in which case, the program flow skips to and begins executes the statements specified by the <statementsD> element. NOTE: The ooPIC 5.0.1 compiler allows only ONE select/switch construct to have a "case else" or "default" option. BUG: As of compiler 5.0.1 nested select/switch constructs will get unexpected results., |