18.10.2014 Views

SIMSCRIPT II.5 Programming Language

SIMSCRIPT II.5 Programming Language

SIMSCRIPT II.5 Programming Language

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>SIMSCRIPT</strong> <strong>II.5</strong> <strong>Programming</strong> <strong>Language</strong><br />

The above examples have assumed that each new read or write statement starts at the beginning<br />

of a new data record or line. This need not always occur. All read and write statements operate<br />

on a continuous string of characters and only skip to a new data record or output line when so instructed.<br />

Thus, the two statements:<br />

read X as I 5<br />

and<br />

read Y as D(10,2)<br />

read successive fields from the same data record. Often, of course, data are split between data<br />

records, or must be read from noncontiguous parts of the same data record. The current input pointer<br />

and current output pointer are variables that point to the last referenced columns in the input and<br />

output data streams. They can be advanced by the statements:<br />

input record<br />

or<br />

start new output record<br />

and<br />

start new page<br />

as previously described, and also by five non-numeric formats. These formats can be interspersed<br />

among data formats, or they can appear alone in read and write statements. Examples of the use<br />

of these formats are given following their description.<br />

3.4.3.1 B (Beginning Column) Descriptor<br />

This format is used to specify the position in which the first character of an item of input or output<br />

data is found or displayed. The format B n positions the current input/output device at column n.<br />

When several B format descriptors are used within a format list, they do not have to appear in ascending<br />

numeric order. For instance, the format:<br />

B 47, I 10, B 5, D(6,3), B 57, D(7,3), B 20, I 4<br />

prints a line of the following form:<br />

col 5 col 20 col 47 col 57<br />

D(6,3) I4 I10 D(7,3)<br />

______XX.XXX___...____XXXX___...__XXXXXXXXXX__...__XXX.XXX<br />

114

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

Saved successfully!

Ooh no, something went wrong!