18.08.2013 Views

LINC Programming Reference Manual - Public Support Login - Unisys

LINC Programming Reference Manual - Public Support Login - Unisys

LINC Programming Reference Manual - Public Support Login - Unisys

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

BEGIN.LOOP (BG)<br />

BEGIN.LOOP (BG)<br />

Syntax<br />

Examples<br />

<strong>Reference</strong>s<br />

The BEGIN.LOOP; command allows a series of logic commands to be executed repeatedly.<br />

Loops can be nested within loops.<br />

A condition should be included to specify when the loop is to be broken.<br />

If the loop is closed with an END.EXIT; command, and that command is actioned (that is,<br />

the loop is not broken earlier by some other means), then the loop is not repeated, and the<br />

current Ispec or Report is exited as normal for an END.EXIT; command.<br />

DDD DDD DDBDDDDD DDDDDDBD4<br />

3 3<br />

CDDD DDD4<br />

3 3<br />

@D DY<br />

In the following example, if SORTQUES is an alphanumeric data item containing<br />

ZYXWVUTSRQPOMNLKJIHGFEDCBA, the result in SORTANS (which has LENGTH at<br />

least 26) is ABCDEFGHIJKLMNOPQRSTUVWXYZ.<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

Or, in a Report, the following logic could be used to print Frame 6 when a valid product<br />

name is input. The loop is used to repeat the prompt and input if an invalid product name is<br />

supplied.<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

‘‘BREAK (BK)’’ and ‘‘JUMP.TO (JTO)’’, associated with a ‘‘DO.WHEN (DW)’’ to terminate<br />

the loop.<br />

1-46 v

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!