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


7 Statements

A computer program in the LUX language is a set of statements, which are executed in the order in which they are encountered. Statements execute commands and control the flow of execution. Statements usually involve expressions and may contain other statements.

LUX offers many statements. The assignment and insertion statements allow storage of data in variables. The if, case, and ncase statements allow branching, i.e., execution of statements depending on one or more conditions. The for, repeat, WHILE-DO, and DO-WHILE statements allow loops, i.e., repetition of statements. A block statement allows a set of statements to be treated as a single one. The block routine (block), subroutine (subr), and function (func) definition statements allow definition of routines written in the LUX language. Block routine and subroutine calls allow these user-defined routines to be used. The jump statements break, continue, retall, and return allow (restricted) forced exit from loops and routines. File inclusion statements (@ and @@) allow the contents of a file to be read and executed.

In the formal description of the syntax of these statements, square brackets [] enclose optional parts, and dots … indicate that the preceding phrase may be repeated.


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