ClassesClasses | | Operators

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.

casecaseCaseCase (Operator)

Name

casecaseCaseCase — 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)

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 HTupleHTupleHtuple (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

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

Alternatives

elseifelseifElseifElseifElseif

See also

switchswitchSwitchSwitchSwitch, defaultdefaultDefaultDefaultDefault, endswitchendswitchEndswitchEndswitchEndswitch, ififIfIfIf

Module

Foundation


ClassesClasses | | Operators