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

MAIN PROGRAM<br />

SUBPROGRAM<br />

SUBPROGRAM<br />

END<br />

Figure 2-5a. Program Consisting of a Subprogram Called by a Main Routine<br />

In Figure 2-5a, the main routine calls on the subprogram in two places. In each instance, after executing<br />

its statements, the subprogram returns control to the main routine at the statement following<br />

the one that called it.<br />

Figure 2-5b shows a slightly more complicated program composed of a main routine and two subprograms.<br />

The main routine calls on each of the subprograms. They are independent of each other.<br />

MAIN PROGRAM<br />

SUBPROGRAM<br />

1<br />

SUBPROGRAM<br />

2<br />

SUBPROGRAM 1<br />

END<br />

Figure 2-5b. Program Consisting of Two Subprograms Called by a<br />

Main Routine<br />

53

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

Saved successfully!

Ooh no, something went wrong!