【机器视觉】 case算子

00. 目录

文章目录

    • 00. 目录
    • 01. 概述
    • 02. 签名
    • 03. 描述
    • 04. 注意
    • 05. 参数
    • 06. 结果
    • 07. 附录

01. 概述

case - 跳转标记,在switch段内开启一个分支。

02. 签名

case( : : Constant : )

03. 描述

​ case定义了一个switch段的跳转标记。 如果switch语句的控制表达式的值与Constant中定义的常量整数表达式相匹配,它将执行分支的内容。 对于这个参数,只接受常量整数表达式。 变量表达式和其他数据类型是不可行的。

如果在编程语言C,C ++和C#中,case语句不打开在下一个case或default语句中自动留下的块(As in the programming languages C, C++, and C# the case statement does not open a block that is automatically left at the next case or default statement. )。 相反,它就像一个goto标记,如果标记匹配,就可以访问。 为了离开一个case分支并在switch段结束后继续执行,break语句可以在switch段的任何地方使用。

原文描述

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

04. 注意

05. 参数

Constant (input_control)   integer → (integer)
用于确定访问分支的switch控制表达式的哪个值的常量整数表达式。
Default value: 1

06. 结果

case(作为算子)总是返回2(H_MSG_TRUE)。

HDevelop例程

switch_case.hdev Use switch/case statement for a multiway branch

程序示例

07. 附录

7.1 机器视觉博客汇总
网址:https://dengjin.blog.csdn.net/article/details/116837497


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部