Next: , Previous: , Up: Statements   [Contents][Index]


7.9 Block Statement

A block statement disguises a set of statements as a single statement by enclosing it in curly braces { } or in a BEGIN-END pair.

BEGIN statement1 [ statement2 … ] END
{ statement1 [ statement2 … ] }

Block statements are mainly used to circumvent the one-statement limit to the loop statements (FOR Statement, REPEAT Statement, WHILE-DO Statement, DO-WHILE Statement).

For example,

LUX>x = 0
LUX>FOR i = 1,4 { x = x + i  T,x }
     1
     3
     6
    10
LUX>