Listing 12. The case statement.
清单12.case语句。
CASE not found for CASE statement.
说明:案例没有发现CASE语句。
Listing 30. Example of a case statement in bash.
清单30. bash中的case语句示例。
It looks just like a C-style case statement, right?
看起来很像c风格的case语句,对吧?
Listing 7 extends this case statement to handle delayed_job roles.
清单7扩展了这个case语句,来处理delayed_job角色。
The instructions for each server type are wrapped in a case statement.
每一个服务器类型的说明都封装在一个case语句中。
Then, a second case statement is used to identify the path of the request.
随后,使用第二条case语句来识别请求的路径。
Earlier versions of Oracle only supported a limited version of the CASE statement.
早期版本的Oracle仅支持受限制的case语句。
If the values of that column are not a time stamp you will have to do a CASE statement.
如果该列不是一个时间戳,你将不得不做一个值情况语句。
A case statement within bash lets you test for more than one condition or value and act accordingly.
bash中的case语句可以用来测试多个条件或值并相应地执行操作。
Pattern matching is the familiar case statement from your favorite C-like language, but on steroids.
你也可以把模式匹配想象成你最喜欢的c类语言的case指令,当然是打了激素的。
The case statement is another conditional statement that you can use in place of using an if statement.
case语句是另一种条件型语句,您可以用该语句来替代if 语句。
Listing 1 shows an example of an SQL procedure with a case statement with a simple-case-statement-when-clause.
清单1展示了一个SQL过程的示例,包含一个case语句和一个simple - case - statement - when - clause。
A case statement allows you to quickly build upon it as your script evolves and needs to perform different tasks.
当您的脚本变得比较复杂、并且需要执行不同的任务时,可以使用case语句迅速地进行构建。
So, each time this section of code is executed, the $TIME is checked to see if it matches the times of the case statement.
因此,每次执行这个代码段的时候,将检查 $TIME是否匹配case语句所指定的时间。
Then, it updates its Internet control block with the foreign IP address and port number and returns to the PRU_CONNECT case statement.
然后使用外来ip地址和端口号更新其Internet控制块,并返回到PRU_CONNECT示例语句。
For each option, the case statement then attempts to identify the option, using either the short or long format and setting a variable.
对于每个选项,case语句会尝试识别该选项——使用短格式或长格式并设置一个变量。
This case statement simply checks the second command-line argument, and performs the correct action, depending on its value. If we now type
这条 case 语句只是检查第二个命令行自变量,然后根据其值执行正确操作。
Although it isn't the optimal solution, multiple elif statements can be used to mimic the switch case statement present in some other languages.
尽管它不是最优的解决方案,但是多个elif语句可以用于模拟其他一些语言中的switchcase语句。
Consider the code above and realize that any enumerated value not specifically processed by a case statement is instead processed by the default statement.
研究以上代码可以看出,任何没有被case语句处理的枚举值都会被default语句处理。
The getopts command returns true if an option is found, so a common option processing paradigm uses a while loop with a case statement as in this example.
如果找到一个选项,则getopts命令返回true,因此常见的选项处理范例使用带case语句的while 循环,本例中就是如此。
To have just your public IP address returned and then use that IP address in a case statement in your scripts that need to change from one site to another.
返回公共ip地址,然后在需要修改的脚本中的case语句中使用这个IP地址。
For example, you can use it in combination with a case statement to choose the right aliases, as per the ps examples in the previous section, like Listing 10.
例如,可以按照前一部分中的ps示例,将该命令与case语句结合使用以选择正确的别名,如清单10所示。
Let's take advantage of that and set the discount while we are creating the table in the first place. The following use of a CASE statement will take care of that for us.
我们可利用这个优势,可在首次创建表时设置discount。
The prior section discussed the two submission elements and highlighted two statements in each submit definition that referenced the same tokens these case statement reference, teo and yah.
前面的部分讨论了两个submission元素并重点研究了每个submit定义中的两条语句,该语句引用了与case 语句引用的相同的标志,即teo 和 yah。
The case statement works like its counterparts in traditional programming languages: It compares its argument to each pattern in a list; when a match is found, the corresponding code executes.
case语句的工作方式与传统编程语言中的对应结构相似。它将其参数与列表中的每个模式比较;当找到匹配项时,则执行对应的代码。
"For whatever reason, they were still hanging out on the Antarctic continent," Case said in a statement.
“无论是什么原因,它们确实一直在南极大陆上生活,”凯斯在一份声明中说。
This statement serves as the use case name.
这个陈述作为这个用例的名称。
Jumping into a statement expression with goto or using a switch statement outside the statement expression with a case or default label inside the statement expression is not permitted.
不允许使用switch语句或是goto跳入到声明表达式中。
Jumping into a statement expression with goto or using a switch statement outside the statement expression with a case or default label inside the statement expression is not permitted.
不允许使用switch语句或是goto跳入到声明表达式中。
应用推荐