OP

Syntax

OUTPUT object

OP object

Explanation

OUTPUT makes its input the output of the procedure. OUTPUT can only be used within a procedure. After the object of OUTPUT is run, control returns to the calling procedure or to toplevel.

Example

HYPOT calculates the hypotenuse of an isosceles right triangle with the Pythagorean Theorem (C*C = A*A + B*B) and uses OUTPUT to send that value to the ISOS procedure.

TO HYPOT :SIDE


 * OUTPUT SQRT (2 * (:SIDE * :SIDE))

END

TO ISOS :SIDE


 * FD :SIDE


 * RT 90


 * FD :SIDE


 * RT 135


 * FD HYPOT :SIDE


 * RT 135

END

? ISOS 30