OUTPUT (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.

 

Examples 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
HYPOT defined

TO ISOS :SIDE
     FD :SIDE 

     RT 90 
     FD :SIDE 
     RT 135 
     FD HYPOT :SIDE 
     RT 135 
END
ISOS defined


 

TopIndex