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

7.10 Block Routine Definition

A block routine is a set of statements to which a name has been assigned.

BLOCK name
[ statement2
  … ]

The name of the block routine must start with a letter, and subsequent characters of the name must be letters, digits, or the character _.

Block routines can be defined at the main level of execution (i.e., at the ‘LUX>’ prompt), or inside a user-defined function (Function Definition) or subroutine (Subroutine Definition). The variables used inside a block routine are local (Local Variables) to the main execution level or to the function or subroutine in which the block routine is defined. Block routines should only be executed in the same context in which they were defined. At present, a block routine that is defined inside a function or subroutine still appears in a dump (dump) at the main level of excution, and is not deleted when the function or subroutine in which it was defined is. This behavior needs to be streamlined.

See Block Routine Execution for execution of such a block routine.