使用右上角的选项卡切换到不同的编程语言。

使用右上角的选项卡切换到不同的编程语言。

使用右上角的选项卡切换到不同的编程语言。

使用右上角的选项卡切换到不同的编程语言。

casecaseCaseCasecase (Operator)

名称

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.

默认值: 1

结果

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

替代算子

elseifelseifElseifElseifElseifelseif

另见

switchswitchSwitchSwitchSwitchswitch, defaultdefaultDefaultDefaultDefaultdefault, endswitchendswitchEndswitchEndswitchEndswitchendswitch, ififIfIfIfif

模块

Foundation