DO CASE ... ENDCASE Command
Executes the first set of commands whose conditional expression evaluates to true (.T.).
DO CASE CASE lExpression1 [Commands] [CASE lExpression2 [Commands]] ... [CASE lExpressionN [Commands]] [OTHERWISE [Commands]] ENDCASE |
Parameters
- CASE lExpression1 Commands...
-
When the first true (.T.) CASE expression is encountered, the set of commands following it is executed. Execution of the set of commands continues until the next CASE or ENDCASE is reached. Execution then resumes with the first command following ENDCASE.
If a CASE expression is false (.F.), the set of commands following it up to the next CASE clause is ignored.
Only one set of commands is executed. These are the first commands whose CASE expression evaluates to true (.T.). Any succeeding true (.T.) CASE expressions are ignored.
- OTHERWISE Commands
-
If all of the CASE expressions evaluate to false (.F.), OTHERWISE determines if an additional set of commands is executed.
-
If you include OTHERWISE, the commands following OTHERWISE are executed and execution skips to the first command following ENDCASE.
-
If you omit OTHERWISE, execution skips to the first command following ENDCASE.
-
Remarks
Example
See Also
© , 1996-2020 • Updated: 11/10/20
Comment or report problem with topic
Microsoft Visual FoxPro 9 SP2 Help file, VFPX Edition v1.08