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>Programming</strong> <strong>Language</strong> Concepts<br />

Examples:<br />

1.0067E+10 1.0067+10<br />

9.46755+04 9.46755E4<br />

4.0E1 4.0+1<br />

9.999-6 9.999E-06<br />

5E6 5+6<br />

3.4.2.4 T (Text) Descriptor<br />

A descriptor of the form n T w is used to read and write formatted text from and to an external<br />

medium. The descriptor is similar in form and action to the I descriptor. The variable to be read<br />

or printed must have been declared as a text variable. Text literals appearing in a write list<br />

must be output using a T format descriptor.<br />

When used for input, the statement reads as a text string the next w characters from the current input<br />

record. Any printable character that can be typed on a terminal or input record, including blanks,<br />

will be accepted as part of the string. The input record column position indicator is advanced by<br />

the field width.<br />

When used in output statements, the T format displays successive characters, starting from the leftmost<br />

position of a string, and displaying from the leftmost column position within the field. Each<br />

character of the string is printed until either the string is exhausted or the end of field is reached. In<br />

either case, the output record column position indicator is advanced to the end of the field.<br />

In cases where the length of a text variable is not known, or may vary, the entire text variable<br />

may be simply output using the format:<br />

write text variable as t *<br />

which begins writing at the current output column and continues writing until the entire text string<br />

is printed. If the output string will not fit on the remaining space on the output record, the string<br />

may overflow to one or more subsequent records. The output record column is positioned after the<br />

last character written.<br />

3.4.2.5 A (Alphanumeric) Descriptor<br />

Any printable character that can be typed on a terminal or input record, including a blank character,<br />

may be read under an alpha format. The alphanumeric descriptor n A w is similar to the I descriptor<br />

in form and action. On input, the content of a specific field is assigned as the value of a corresponding<br />

variable in the read list. This variable must have been declared as alpha. The manner<br />

in which characters read are placed within the alpha variable may vary, depending on machine and<br />

alpha implementation. In general, where only one character is represented in each alpha vari-<br />

109

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

Saved successfully!

Ooh no, something went wrong!