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 />

This specifies that columns to the right of the indicated column do not contain program statements.<br />

These columns appear on all program listings produced during compilation, but are not treated as<br />

part of the program text. Each time a last column card is used in a preamble, the number of<br />

program statement columns may change. The last last column statement used in a preamble applies<br />

to all subprograms that follow. This statement may not appear in individual routines within a<br />

program. The simplest preamble, used to specify sequence number columns, is:<br />

preamble<br />

last column is 72<br />

end<br />

This specifies that in all succeeding cards only columns 1 through 72 contain program statements.<br />

Columns 73 through 80 are listed but ignored during compilation.<br />

2.29 A Useful Output Statement<br />

There are occasions when it is useful to generate clearly labeled values of selected variables with<br />

no attempt at explicit formatting. This is particularly helpful when checking for programming errors,<br />

for example.<br />

The list statement prints labeled values of expressions and variables. The form of the statement is:<br />

list variable name or expression list<br />

Explicitly subscripted variables and entire array names may be included in the list. Expression and<br />

array values are printed in standard formats. These formats vary somewhat on different implementations.<br />

In general, expression values are printed in rows across a page with the "name" of each expression<br />

beside its value. Thus a request to:<br />

list A, B(1), A*B(1)<br />

might produce the output:<br />

A = 2.000000 B(1) = 3.500000 A*B(1) = 7.000000<br />

If unsubscripted array names appear in the list, all elements of the array are listed in the output with<br />

each element value labeled with its corresponding subscripted array name. As many values are<br />

placed on each line as will fit, according to spacing conventions. Such conventions usually allow<br />

the name of the variable justified on the left in a field aligned to a column multiple of 16, followed<br />

by the value of the variable. A minimum of two character positions is allowed between successive<br />

variable fields across a line. Text and alpha variables values are enclosed in double quotation<br />

marks.<br />

94

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

Saved successfully!

Ooh no, something went wrong!