Use the tabs on the upper right to switch to a different programming language.

Use the tabs on the upper right to switch to a different programming language.

Use the tabs on the upper right to switch to a different programming language.

Use the tabs on the upper right to switch to a different programming language.

casecaseCaseCasecase (Operator)

Name

casecaseCaseCasecase — Jump label that starts a branch within a switchswitchSwitchSwitchSwitchswitch block.

Signature

case( : : Constant : )

Herror case(const Hlong Constant)

Herror T_case(const Htuple Constant)

void Case(const HTuple& Constant)

static void HOperatorSet.Case(HTuple constant)

def case(constant: int) -> None

Description

casecaseCaseCaseCasecase defines a jump label within a switchswitchSwitchSwitchSwitchswitch block. It starts a branch that is executed if the value of the control expression of the switchswitchSwitchSwitchSwitchswitch statement matches the constant integer expression that is defined in ConstantConstantConstantConstantconstantconstant. For this parameter only constant integer expressions are accepted. Variable expressions and other data types are not allowed.

As in the programming languages C, C++, and C# the casecaseCaseCaseCasecase statement does not open a block that is automatically left at the next casecaseCaseCaseCasecase or defaultdefaultDefaultDefaultDefaultdefault statement. In contrast, it works just like a goto label that is accessed if the label matches. In order to leave a casecaseCaseCaseCasecase branch and continue execution after the end of the switchswitchSwitchSwitchSwitchswitch block, the breakbreakBreakBreakBreakbreak statement can be used anywhere within the switchswitchSwitchSwitchSwitchswitch block.

Parameters

ConstantConstantConstantConstantconstantconstant (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Constant integer expressions that determines for which value of the switch control expression the branch is accessed.

Default value: 1

Result

casecaseCaseCaseCasecase (as an operator) always returns TRUE.

Alternatives

elseifelseifElseifElseifElseifelseif

See also

switchswitchSwitchSwitchSwitchswitch, defaultdefaultDefaultDefaultDefaultdefault, endswitchendswitchEndswitchEndswitchEndswitchendswitch, ififIfIfIfif

Module

Foundation