File: continue.txt

package info (click to toggle)
colobot 0.2.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 415,532 kB
  • sloc: cpp: 129,246; ansic: 8,872; python: 2,158; sh: 672; awk: 91; xml: 35; makefile: 31
file content (25 lines) | stat: -rw-r--r-- 685 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
\b;Instruction \c;continue\n;
Syntax :
\s;\c;while ( condition )
\s;{
\s;	continue;
\s;}
\n;
With this instruction, you can jump over the rest of instructions in the \c;\l;bloc\u cbot\bloc;\n; of a \c;\l;while\u cbot\while;\n; or \c;\l;for\u cbot\for;\n; loop: The execution will resume at the beginning of the bloc, the next time the loop is repeated.
 
Here is an example:
\s;\c;int i = 0;
\s;while ( i < 5 )
\s;{
\s;	i = i+1;
\s;	if ( i == 3 )
\s;	{
\s;		continue;
\s;	}
\s;	\n;Instructions ...\c;
\s;}
\n;
The instructions will only be executed for the values of \c;i\n; 1, 2, 4 and 5.

\t;See also
\l;Programming\u cbot;, \l;types\u cbot\type; and \l;categories\u cbot\category;.