*SKIP

<< Click to Display Table of Contents >>

Navigation:  Reference > Pre-processor >

*SKIP

The *SKIP command tells the Pre-processor to skip to a place later on in the CL script, carrying out no processing in between. The skip may be unconditional, or, as is more usual, conditional upon the values of one or more indices. Skips are most commonly used in loops to allow for exceptions to the looping.

The destination of a skip is called a PP label; these are defined by the 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 for two different PP labels. A *SKIP command always skips to the next occurrence of the designated PP label.

A skip may be to a destination after the end of the current loop, in which case the loop is effectively "closed" and the loop index unset. A skip may not be to a destination inside a not-yet-opened loop, as the loop index would not be set on entry.

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

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

Always skip

An unconditional skip takes the form:

[*SKIP n]

where n is a PP label number.

Example of *SKIP command:

[*skip 13]

Value comparison

[*SKIP 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

So, for example:

[*skip 3 on Loop.eq.1] 

would cause a skip to PP label 3 when index Loop had the value 1.

Example of *SKIP command:

[*skip 5 on Part1+part2.gt.6]

Text comparison

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

[*SKIP n STRING ’r;text'.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:

[*skip 3 string dlList.volume.eq.'na']

...

[*3]

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

Examples of *SKIP commands:

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

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

[*skip 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

A special form of the *SKIP command allows you to test for an index being unset. The form is as follows:

[*SKIP n NULL x]

This will cause a skip to PP label n if x is unset.

Integer value cell test

[*SKIP n INTEGER cellref]

This will cause the code down to PP label n only to be processed if the cell is not a valid integer value which could be used in *SET command. Note that 12.0 is treated as a valid integer.

Example of *SKIP command:

[*skip 20 integer dlList.value] 

Empty cell test

[*SKIP n EMPTY cellref]

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

Example of *SKIP command:

[*skip 20 empty dlList.count]

Last iteration (SLE)

A special form of the skip command (Skip Last to End):

[*SLE]

causes a skip to the end of the current loop on the last time through - when the index takes the last value assigned to it in the previous *DO or *FOR command.

This cannot be used with *DBLOOP and *DBEND except when *LAST is used.