But even with the simplicity of this loop construct, you can build any complex loop.
然而仅仅使用简单的循环结构,您也能构建任意复杂的循环。
For tasks that execute code in a loop, it is common to check for interruption only once per loop iteration.
对于执行一个循环中的代码的任务,通常只需为每一个循环迭代检查一次中断。
All four variables are declared outside the loop and therefore have excessive scope even though they're only used inside the loop.
所有这四个变量都是在循环外声明的,尽管它们仅在循环内部使用,但作用域不止于此。
In cases where a break combination is part of an alternative or a loop, then only the alternative or loop is exited.
在这种情况下,跳转组合是变体或者循环的一部分,然后只是变体或循环被退出。
The loop in this sequence diagram USES a Boolean test to verify if the loop sequence should be run.
如果循环序列应该运行,这个序列图的循环使用一个布尔测试确认。
The advantages of adding a loop are that the loop is visible, and that you can control the rate of iterations through the loop if needed.
添加一个循环的好处在于循环是可见的,并且如果需要的话您可以通过循环控制迭代的速率。
Remember also that each iteration through the loop wastes time, so rather than working through the same loop a number of times, try to perform all the actions in one pass through the loop.
还要记住的是,在循环中,每次反复都是在浪费时间,因此不要多次使用相同的循环,而是要尽量在一个循环中执行所有的操作。
The reasonable approach is to do the basic flow once, do a loop once, and then do a loop a second time.
最合理的方法是做一遍基本流程,一遍循环流程,然后再做一遍循环流程。
Like any software reading a file, the parser is built around a reading loop: a loop that progresses through the file.
和读取文件的任何软件一样,解析器也是围绕着读循环(读入文件的循环)创建的。
Your code should (almost) never have multiple nested loops (a loop inside a loop inside a loop). Most of the code written today should use Hashtables, simple lists and singly nested loops.
在编写代码时应尽量避免嵌套循环,目前大多数代码都是使用了哈希表、简单链表和单循环。
Then we loop over columns (first loop) and add the rest of the header cells to this row and add the row to the provider after the looping is done.
然后,我们将遍历列(第一次循环)并将其余的标题栏单元格添加到该行,并在遍历结束之后将该行添加到提供程序。
This means the program statements executed in the loop body must change the value of the expression — or else the loop will never end.
这意味着循环体中执行的程序语句必须要改变表达式的值,否则循环将无法结束。
And what's this little loop say to do? This little loop says I'm going to write a function or procedures that takes in two messages.
这个小循环是做什么的,这个小的循环是,我要写一个函数或者过程来接受两条消息。
A while loop is a loop that repeats the included activities while some condition is satisfied.
一个while循环在满足一些条件的情况下,将重复所包含的活动。
That's why the main test method in Listing 1 USES a while loop instead of a new for loop.
这就是为什么清单1中的main测试方法使用while循环而不是一个新的for循环。
Now instinctively, prefer the for loop or the while loop?
现在凭感觉,你们喜欢for循环还是while循环?
The routing between the general step (with no name) and While Loop contains logic that corresponds with the loop condition.
通用步骤(没有任何名称)和While循环之间的路由包含与循环条件对应的逻辑。
Most of the time, we just slap Iterator inside a for() loop or enhanced for() loop and move on, so to speak.
可以这么说,大部分时间我们只是将Iterator 随意放到for()循环或加强 for() 循环中,然后就继续其他操作了。
The main loop enters an indefinite loop, waiting for events and calling callbacks, until someone calls gtk_main_quit() by closing the window.
主循环进入无限循环,等候事件并调用回调,直到有人关闭窗口,调用 gtk_main_quit() 为止。
To summarize: use the enhanced for loop by default, but consider a hand-written counted loop for performance-critical ArrayList iteration.
结论:优先采用改进for循环,但在性能要求苛刻的ArrayList迭代中,考虑采用手写计数循环。
Modeler loops are mapped to FileNet constructs for each loop, by having one step to represent the condition check in the loop, and another step to represent the contents of the loop.
Modeler循环映射到每个循环的FileNet构造,方法是使一个步骤表示循环中的条件检查,使另一个步骤表示循环的内容。
It contains a nested loop that calls exp , cos , and sin , followed by a loop that calls sin and SQRT .
它包含了一个嵌套的循环,该循环会调用exp 、cos以及sin,接下来是一个调用sin和sqrt的循环。
The Structures folder in the palette now includes a repeat until loop that repeats the activities in the loop container, until a condition is true.
面板中的Structures文件夹现在包括RepeatUntil循环,此循环重复循环容器中的活动,直到某个条件为True。
This is less "robust" in a sense than OS threads -- but it would not require much extra machinery to catch exceptions inside scheduler()'s loop rather than outside the loop.
这在某种意义上“健壮性”不如OS线程 ―不过在scheduler()的循环内捕获异常不会比在循环外需要更多的机器资源。
Some models are decomposed into multiple levels, such as a While loop within a local subprocess, within a While loop.
有些模型被分解为多个级别,例如While循环中的局部子流程中的While循环。
If you clicked + to expand a while loop, the editor showed just the contents of the while loop.
如果单击+以展开while循环,编辑器仅显示while循环的内容。
In this loop, a new PatientRecord is returned each time the loop is executed.
在该循环中,一个新的PatientRecord在每次执行循环时返回。
The first improvement (which is also supported by modern versions of C) is to move the declaration of the i loop variable inside the loop, as shown in Listing 7
第一项改进(C 语言的现代版本也支持这项改进)是将i循环变量的声明移到循环之内,如清单 7 所示
The enhanced for loop, sometimes called the for-each loop, is translated by the compiler as if the programmer had supplied the equivalent old-style for loop.
增强的for循环有时叫做for - each循环,编译器编译它的时候,情形与程序员提供旧式for循环一样。
The enhanced for loop, sometimes called the for-each loop, is translated by the compiler as if the programmer had supplied the equivalent old-style for loop.
增强的for循环有时叫做for - each循环,编译器编译它的时候,情形与程序员提供旧式for循环一样。
应用推荐