User Tools

Site Tools


case_conditional_execution_structure_.htm
Navigation:  Templates > Template Language Reference > Complete Alpha Listing >====== #CASE (conditional execution structure) C6H0068.jpg ====== Previous pageReturn to chapter overviewNext page

#CASE( condition )

#OF( expression )

[ #OROF( expression ) ]

statements

[ #ELSE

statements ]

#ENDCASE

blk2blue.jpg

#CASE Initiates a selective execution structure.
condition Any Template Language expression which returns a value.
#OF The #OF statements are executed when the #OF expression is equal to the condition of the CASE. There may be many #OF options in a #CASE structure.
expression Any Template Language expression which returns a value.
#OROF The #OROF statements are executed when the #OROF expression is equal to the condition of the #CASE. There may be many #OROF options associated with one #OF option.
#ELSE The #ELSE statements are executed when all preceding #OF and #OROF expressions are not equal to the condition of the #CASE. #ELSE (if used) must be the last option in the #CASE structure.
statements Any valid executable source code.
#ENDCASE Terminates the #CASE structure.

A #CASE structure selectively executes statements based on equivalence between the #CASE condition and one of the #OF or #OROF expressions. If there is no exact match, the statements following #ELSE are executed. The #CASE structure must be terminated by #ENDCASE. If there is no #ENDCASE, an error message is issued during Template file pre-processing. #CASE structures may be nested within other #CASE structures.

Example:

#CASE(%ScreenField)

 #OF('?Ok')

   #INSERT(%OkButtonGroup)

 #OF('?Cancel')

 #OROF('?Exit')

   #INSERT(%CancelButtonGroup)

 #ELSE

   #INSERT(%OtherControlsGroup)

#ENDCASE

case_conditional_execution_structure_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1