Operator Reference

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)

casecaseCaseCasecase — Jump label that starts a branch within a switchswitchSwitchSwitchswitch 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

casecaseCaseCasecase defines a jump label within a switchswitchSwitchSwitchswitch block. It starts a branch that is executed if the value of the control expression of the switchswitchSwitchSwitchswitch statement matches the constant integer expression that is defined in ConstantConstantConstantconstantconstant. 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 casecaseCaseCasecase statement does not open a block that is automatically left at the next casecaseCaseCasecase or defaultdefaultDefaultDefaultdefault statement. In contrast, it works just like a goto label that is accessed if the label matches. In order to leave a casecaseCaseCasecase branch and continue execution after the end of the switchswitchSwitchSwitchswitch block, the breakbreakBreakBreakbreak statement can be used anywhere within the switchswitchSwitchSwitchswitch block.

Parameters

ConstantConstantConstantconstantconstant (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: 1

Result

casecaseCaseCasecase (as an operator) always returns 2 ( H_MSG_TRUE) .

Alternatives

elseifelseifElseifElseifelseif

See also

switchswitchSwitchSwitchswitch, defaultdefaultDefaultDefaultdefault, endswitchendswitchEndswitchEndswitchendswitch, ififIfIfif

Module

Foundation