![Advantech UbiQ User Manual Download Page 54](http://html1.mh-extra.com/html/advantech/ubiq/ubiq_user-manual_2856809054.webp)
UbiQ Scenario Manager User Manual
48
A block statement typically appears as the body of another statement, such as the if
statement.
Syntax
block-statement :
{ declaration-list statement-list }
declaration-list :
declaration or
declaration-list declaration
statement-list :
°°°°°°°°°°statement or
°°°°°°°°°°statement-list statement
If there are declarations, they must come before any statements. The scope of each
identifier declared at the function including the block-statement.
This example illustrates a compound statement:
if ( i > 0 )
{
line[i] = x;
x=x+1;
i=i-1;
}
In this example, if i is greater than 0, all statements inside the compound statement
are executed in order.
break statement
The break statement terminates the execution of the nearest enclosing for, or while
statement in which it appears. Control passes to the statement that follows the termi-
nated statement.
Syntax
break-statement :
break;
Within nested statements, the break statement terminates only the for, or while state-
ment that immediately encloses it. You can use a return statement to transfer control
elsewhere out of the nested structure.
This example illustrates the break statement:
Summary of Contents for UbiQ
Page 1: ...User Manual UbiQ Scenario Manager User Manual V1 03...
Page 4: ...UbiQ Scenario Manager User Manual iv...
Page 7: ...Chapter 1 1 Introduction...
Page 13: ...Chapter 2 2 Getting Started...
Page 37: ...Chapter 3 3 Tutorials...
Page 47: ...Chapter 4 4 Basic of Smart C Script Language...
Page 62: ...UbiQ Scenario Manager User Manual 56...