*BLOCK

<< Click to Display Table of Contents >>

Navigation:  Reference > Pre-processor >

*BLOCK

The *BLOCK command tells the Pre-processor to process the following code, down to a stated destination further on, if a specified condition is true. If the condition is false, the block of code is to be ignored.

The destination of a *BLOCK command is called a PP label; these are defined by the PP label command. PP labels are numeric (may have any value between 1 and 1000000000). The numbers assigned have no significance, and the same number may be used twice. A *BLOCK command always skips to the next occurrence of the designated PP label.

NOTE: an unconditional *BLOCK command is not allowed.

A *BLOCK command may cause a skip to a destination outside the current loop, in which case the loop is effectively "closed" and the loop index unset. The skip may not be to a destination inside a not-yet-opened loop.

All PP labels referenced in *BLOCK commands must appear in label commands after the *BLOCK command and before the end of the file being processed.

See also the *SKIP command which is the reverse of *BLOCK.

Value comparison

[*BLOCK n ON AE.op.AE]

where n is a PP label number, and op is one of the standard relational operators:

.GT.  greater than

.LT.  less than

.EQ.  equal to

.NE.  not equal to

.LE.  less than or equal to

.GE.  greater than or equal to

So, for example:

[*block 3 on Loop.eq.1]

...

[*3]

would cause the code to be processed only when index Loop had the value 1.

Example of *BLOCK command:

[*block 5 on This+That.gt.6]

Text comparison

[*BLOCK n STRING cellref.op.'text']

where n is a PP label number, and op is one of the standard relational operators, see above. The text must be enclosed in single quotes. The comparison ignores case, so "ABC" is less than "aaa".

So, for example:

[*block 3 string DBList.volume.ne.'na']

...

[*3]

would cause the code to be processed only when the cell headed "volume" did not contain "na".

Examples of *BLOCK commands:

[*block 5 string dlNames.Name.eq.'fred']

[*block 99 string ’r;[@ThisText]’.eq.’NA’]…[*99]

[*block 99 string ’r;[@ThisText]’.ne.’[@ThatText]’]…[*99]

Notice that when referring to text in an index you should use a substitution within quotes. The @ sign ensures that the text is used in case the index holds something like "0015" which would get substituted as "15" without the @.

Value missing test

[*BLOCK n NULL x]

This will cause the code down to PP label n only to be processed if x is unset.

Example of *BLOCK command:

[*block 10 null Count]

Empty cell test

[*BLOCK n EMPTY cellref]

This will cause the code down to PP label n only to be processed if the cell is empty.

Example of *BLOCK command:

[*block 20 empty dlList.count]