next up previous 63
Next: Control Structures
Up: ICL Procedures
Previous: Direct Commands During Procedure Entry


Saving and Loading Procedures

Procedures created in the above way will only exist for the duration of an ICL session. If we need to keep them longer they need to be saved in a disk file. This is achieved by means of the SAVE command. To save our SQUARE_ROOT procedure on disk we would use:
    ICL> SAVE SQUARE_ROOT
To load it again, probably in a subsequent ICL session we would use the LOAD command.
    ICL> LOAD SQUARE_ROOT
The SAVE command causes the procedure to be saved in a file with name SQUARE_ROOT.ICL in the current default directory. LOAD will load the procedure from the same file, also in the default directory. With LOAD however it is possible to specify an alternative directory if required:
    ICL> LOAD DISK$USER:[ABC]SQUARE_ROOT
If you have many procedures you may not want to save and load them all individually. It is possible to save all the current procedures using the command:
    ICL> SAVE ALL
This saves all the current procedures in a single file with the name SAVE.ICL. These procedures may then be reloaded by the command:
    ICL> LOAD SAVE
The SAVE ALL command is rarely used however, because this command is executed automatically whenever you exit from ICL. This ensures that ICL procedures do not get accidentally lost because you forget to save them.

next up previous 63
Next: Control Structures
Up: ICL Procedures
Previous: Direct Commands During Procedure Entry

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

9th June 1998
E-mail:starlink@jiscmail.ac.uk

Copyright © 2013 Science and Technology Facilities Council