18.10.2014 Views

SIMSCRIPT II.5 Programming Language

SIMSCRIPT II.5 Programming Language

SIMSCRIPT II.5 Programming Language

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.

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

value being stored. This alternative provides the convenience of tally and accumulate<br />

specifications without wasting entity storage space by storing unnecessary information. Declare<br />

OVERRUN as a dummy variable in the preamble declaration:<br />

define OVERRUN as a dummy variable<br />

This declaration saves one location in each JOB entity created. Such savings, resulting from dummy<br />

specifications, can be significant in models requiring a large number of statistical computations on<br />

many entities.<br />

Any preamble-defined variables and attributes can be declared as dummy, but these should only be<br />

used for tally or accumulate purposes.<br />

5.6 Model Verification and Debugging<br />

Even carefully prepared programs are rarely error-free. Errors in a program fall into two categories:<br />

syntactic errors and logical errors. Errors in the syntax of <strong>SIMSCRIPT</strong> <strong>II.5</strong> programs are detected<br />

and reported by the language compiler. Error and warning messages are displayed, referring, where<br />

appropriate, to the program statement line where the error was detected, and usually identifying the<br />

incorrect word or symbol. Such errors may then be corrected and the program resubmitted for compilation.<br />

A listing of the error messages produced by the compiler, together with an explanatory<br />

message for each, is contained in each <strong>SIMSCRIPT</strong> <strong>II.5</strong> user's manual. The compiler also produces<br />

a numbered listing of the statements within each program section compiled, including the preamble<br />

section. Following this listing of each section is a cross-reference listing that names each global<br />

and local variable, entity type, and subprogram referenced, specifying for each its mode, dimensionality,<br />

and the line numbers in which references appear. Variables used as implicit subscripts are<br />

included in this cross-reference. Careful examination of the cross-reference can identify misspelled<br />

variable names, which may otherwise by default be taken as declarations of new local variables,<br />

references to undeclared functions, which may be taken as references to subscripted arrays, and other<br />

typographical errors in program preparation.<br />

If syntax errors are detected within subprograms (but not within the preamble section), it is only<br />

necessary to recompile those incorrect routines, preceding them with a copy of the preamble statements<br />

as input to the compiler. This feature of separate routine compilation facilitates the preparation<br />

of large programs containing many routines.<br />

Recall that some special routines may be generated by the compiler to perform such tasks as set<br />

management, entity creation, and statistics gathering. If the preamble has not been altered, the redundant<br />

regeneration of these routines may be suppressed by prefixing the word old to the preamble<br />

definition. In addition, even the compiled listing of this preamble may be suppressed by titling<br />

it very old preamble in the definition.<br />

Alternatively, we should explain that certain statements and programming constructs in<br />

<strong>SIMSCRIPT</strong> <strong>II.5</strong> are implemented by generating a number of additional <strong>SIMSCRIPT</strong> <strong>II.5</strong><br />

232

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

Saved successfully!

Ooh no, something went wrong!