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 (算子名称)

名称

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

参数签名

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

描述

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.

参数表

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

结果

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

可替代算子

elseifelseifElseifElseifElseifelseif

参考其它

switchswitchSwitchSwitchSwitchswitch, defaultdefaultDefaultDefaultDefaultdefault, endswitchendswitchEndswitchEndswitchEndswitchendswitch, ififIfIfIfif

模块

Foundation