Procedure
Top  Previous  Next

Definition

N block number{ commands }[[,]occurs]

N
Procedure command
block number  
A number ranging from 0 to 9. The block number must be unique between both N and B type blocks and can only be used once across all shapes in a program.
commands
Any commands in combination.
occurs
Default 0
The number of times the block of commands enclosed in braces will be repeated. The occurs is ignored when the block number is referenced by the repeat command.


Usage

The block and procedure are identical with one minor difference. The block (B) has a default occurrence of 1 while the procedure (N) has a default occurrence of 0. This allows the procedure to define a shape without that shape being represented in the shape until referenced by a repeat (R) command.

The Block command along with its occurs option is used to enclose a series of commands and have those commands used in the shape. Repeating a Block or Procedure is the function of the Repeat command.

The following are all equivalent:

b1{d1,90}

n1{d1,90}
r1


n1{d1,90}1

b1{d1,90}0
r1


r{
d1,90}

In the last example above, the repeat uses the inline block specification.

The difference to using a numbered block vs an inline block, is that the numbered block can be repeated later in the same shape definition with a reference to it by the Repeat command.

The block number is referenced by the Repeat command to repeat the commands enclosed by the { }. The Repeat may optionally specify a number of occurrences the commands are to be repeated.

Repeat block one, four times would be written:

r1,4