next up previous 63
Next: Running a Procedure
Up: ICL Procedures
Previous: ICL Procedures


Direct Entry of Procedures

To enter an ICL procedure we type a PROC command which specifies the name of the procedure, and the names of any of its parameters. ICL then returns a new prompt using the name of the procedure rather than ICL> to show that we are in procedure entry 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.
    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>
The line beginning with { is a comment which will be ignored by ICL when executing the procedure. The closing } is not necessary but looks neater.

next up previous 63
Next: Running a Procedure
Up: ICL Procedures
Previous: ICL Procedures

ICL The Interactive Command Language for ADAM
Starlink Guide 5
J A Bailey
A J Chipperfield

9th June 1998
E-mail:ussc@star.rl.ac.uk

Copyright © 2009 Science and Technology Facilities Council