value

Type

Command component

Purpose

The value keyword is a component of the case command syntax. When processing a case command, DataEase compares the expression that follows case to each of the statements specified by the keyword value in the order they appear in the script. When DataEase reaches the first true comparison, it executes all the actions between that value statement and the next.

If none of the specified value comparisons is true, DataEase executes the actions specified after the keyword others. As soon as all actions following any value or others statement are executed, processing passes to the first action following the end command for the case statement.

Syntax

case ( EXPRESSION)

 value COMPARISON 1 :

  ACTION SERIES 1 .

 [value COMPARISON 2 :

  ACTION SERIES 2 .

 .

 .

 value COMPARISON N :

  ACTION SERIES N . ]

 [others :

  DEFAULT ACTION SERIES . ]

end

 

Usage

The case command requires a case expression, one comparison value, and an end command. Subsequent value statements, actions, and the others keyword are optional. If others is used, it must follow all the specified comparison values.

Example

case ( current user name )

value "FRANK" :

call menu " SITE ADMINISTRATION " .

others :

call menu " MAIN MENU " .

end

 

This script tells DataEase: (1) If the current user is Frank, display the SITE ADMINISTRATION menu, and (2) if the current user is anyone other than Frank, display the MAIN MENU.