next up previous 94
Next: Running procedures
Up: Procedures and command files
Previous: Procedures and command files

Defining procedures -- PROC

To define a procedure, type a PROC command which specifies the name of the procedure and the names of its parameters. ICL then returns a new prompt using the name of the procedure (rather than ICL>) to show that you are in the procedure entry phase of procedure mode. The statements that make up the procedure are then entered, followed by an END PROC or ENDPROC to mark the end of the procedure. For example:

    ICL> PROC SQUARE_ROOT X
    SQUARE_ROOT> { An ICL procedure to print the square root of a number
    SQUARE_ROOT> PRINT The Square Root of (X) is (SQRT(X))
    SQUARE_ROOT> END PROC
    ICL>



next up previous 94
Next: Running procedures
Up: Procedures and command files
Previous: Procedures and command files

ADAM The Starlink Software Environment
Starlink Guide 4
M D Lawden, K F Hartley
12 August 1992
E-mail:ussc@star.rl.ac.uk

Copyright © 2008 Science and Technology Facilities Council