You may have noticed the else clause and the last two examples in Listing 9.
在清单9中可能注意到else子句和最后的两个示例。
When I check the else clause, I see that I was calculating age based on the year only.
在检查完else 子句之后,我明白我只是根据年来计算年龄。
The solution provided is remarkably simple: you add an extra if statement to the else clause.
提供的解决方案非常简单:给else子句添加一个额外的if语句。
At this point, the break statement causes program execution to break out of the while loop, skipping the else clause.
此时,break语句导致程序执行中断while循环,跳转到else子句。
The else clause is never executed, so nothing is printed out until you explicitly use a separate print statement.
else子句永远不被执行,所以直到显式使用 print 语句之前不会输出任何东西。
Once the code finishes iterating through the tuple, the else clause is invoked, and the running total is printed.
一旦代码完成tuple中的迭代,将调用else子句,打印总和。
Otherwise, the else clause is evaluated, and DB2 returns an Info element containing only product ID and message data.
否则,执行else子句,DB2返回一个“info”元素,其中只包含产品ID和评语数据。
The else clause would be modeled by adding another call arrow between the Teller class and the ImproperDepositException.
可以通过在teller类和ImproperDepositException之间添加另一个调用箭头来为else子句建模。
Because the IfExpr is in an expression, unlike a programmatic XSL: if, the else clause is required so there will always be a value.
由于IfExpr是表达式而不是程序性的xsl:if,因此必须有else子句以保证表达式有一个结果。
One special feature of the break statement is that it breaks completely out of the loop, thereby skipping any else clause that follows the loop.
break语句的一个特殊特性是,它完全中断循环,并跳转到循环下面的任一个else子句。
For a while loop, however, this means the code in the else clause is executed once, after the loop is terminated (see the pseudocode shown in Listing 7).
但是对于while循环,这意味着在循环终止后,else子句中的代码被执行一次(参见清单7中的伪代码)。
Once the code has iterated over all the elements in the tuple, it enters the else clause of the for loop, which prints out the value of the count variable.
一旦代码已经迭代了tuple中的所有元素,它将进入for循环的else子句,打印count变量的值。
Because there is rarely an explicit check on the invariants that are expected to be held in an else clause, it's a good idea to make that clear in your code.
因为我们很少对else子句中希望保留的不变量进行显式检查,所以在代码中清楚说明该不变量是一个不错的主意。
All right, if this is purely a test of, if this is true do this otherwise I don't care, I don't need the ELSE clause in there to identify it. All right?
好,如果这真是一个测验,用来测试如果是真的那么进行一些操作,否则的话我不在乎,那么我不需要ELSE语句,来进行声明了对不对?
The if statement supports an optional else clause that indicates a block of program statements that should be processed if the Boolean expression evaluates False.
if语句支持一个可选的else子句,指示当布尔表达式计算为False时应该处理的程序语句块。
The while loop, as was the case with the if statement, supports an optional else clause containing a block of program statements executed when the expression is False.
while循环与if语句一样,支持一个可选的else子句,其中包含一个当表达式计算为False时执行的程序语句块。
Ceylon also ensures (at compile time) that the switch statement contains an exhaustive list of instance tests or, at a minimum, an else clause to provide complete coverage.
Ceylon还确认(在编译时)switch语句包含详尽的实例测试列表,至少包含else子句,从而提供完整的覆盖范围。
IF/THEN/ELSE logic is fertile ground for figuring out how to use WHERE clause predicates so rows can be rejected sooner in DB2's address space.
IF/THEN/ELSE逻辑是搞清楚如何使用WHERE 子句谓词的良好基础,因此在DB2 地址空间中行能够被快速拒绝。
His only other option is to relax his no-trade clause and consider where else he might want to play (and live).
他还有另外一个选择,即放弃自己的“霸王条款”,好好考虑下自己想要在哪打球,在哪生活。
The sentences are classified according to "clause structure", six in all, and nothing else;
这些句子按照“子句结构”划分,总共六个。
The sentences are classified according to "clause structure", six in all, and nothing else;
这些句子按照“子句结构”划分,总共六个。
应用推荐