31.12.2013 Views

TOPS-20 PASCAL Language Manual - Bitsavers

TOPS-20 PASCAL Language Manual - Bitsavers

TOPS-20 PASCAL Language Manual - Bitsavers

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

PROCEDURES AND FUNCTIONS<br />

The function COUPONS computes the total value of a group of coupons.<br />

It uses only the three local variables, ANS, AMOUNT, and SUBT, and<br />

requires no parameters. The result of this function is the real totaJ<br />

of the coupon values. The assignment statement, COUPONS := SUBT,<br />

assigns the result to the function identifier.<br />

To use the function COUPONS, specify its name, as follows:<br />

TOTAL := SUBTOTAL -<br />

COUPONS;<br />

The function call is treated as a real-vaJued expression in this<br />

statement. Note that you can use the function call in the same way<br />

that you can use a value of its result type.<br />

Example 2<br />

FUNCTION SYMMETRY

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

Saved successfully!

Ooh no, something went wrong!