Loading Program Files

Load(F): MonStgElt

(Procedure.) Specify that the file with the name given by the string \(F\) (which may be any expression which evaluates to a string) is to be loaded immediately after this procedure call. Like the load directive below, the file \(F\) will then be read in, and the text will be treated as Magma input. Tilde expansion of file names is allowed. This procedure call may only be used in a simple statement at the top level.

Load(Q): [MonStgElt]

(Procedure.) Specify that the files with the names given by the strings in sequence \(Q\) are to be loaded in order immediately after this procedure call. As above, the files will be read in, and the text will be treated as Magma input. Tilde expansion of file names is allowed. The empty sequence is allowed for \(Q\), in which case nothing is loaded. This procedure call may only be used in a simple statement at the top level.

load "filename";

(Special top level directive.) Input the file with the name specified by the string. The file will be read in, and the text will be treated as Magma input. Tilde expansion of file names is allowed.

A file name that is a valid identifier may also be given without quotes, as in load myfile;. A relative name, quoted or not, is looked for in the current directory, then in the directories listed in MAGMA_PATH, then in each MAGMA_LIBRARIES subdirectory of MAGMA_LIBRARY_ROOT. Unless MAGMA_LIBRARY_ROOT is already set, the magma start-up script sets it to the libs directory of the installation, described in libs/README. See SetPath and SetLibraries in Set and Get.

iload "filename";

(Interactive load: special top level directive.) Input the file with the name specified by the string. The file will be read in, and the text will be treated as Magma input. Tilde expansion of file names is allowed. In contrast to load, the user has the chance to interact as each line is read in:

As the line is read in, it is displayed and the system waits for user response. At this point, the user can skip the line (by moving “down”), edit the line (using the normal editing keys) or execute it (by pressing “enter”). If the line is edited, the new line is executed and the original line is presented again.