Automatic Loading of SPL Functions

 

DADiSP automatically reads two SPL files at startup: dadisp.spl and system.spl. The file system.spl contains a variety of routines that support the DADiSP user interface and in general should not be altered.

 

However, dadisp.spl is reserved specifically for user defined functions. Additional SPL files can be automatically loaded by adding #include directives in dadisp.spl. Because dadisp.spl is reserved for user defined functions, the standard installation does not create this file; it must be created by the user.

 

In general, when a function name is encountered, the following steps are performed to load the function:

 

  1. check if the function is already loaded into memory

  2. if not loaded, search for a file of the same name with extension .OPL

  3. load if the .OPL is found and the file date is newer than the .SPL file

  4. if not loaded, search for a file of the same name with extension .SPL

  5. compile and load the .SPL file

 

Thus, an SPL function that resides in a file of the same name as the function with extension .SPL is automatically loaded when invoked. Explicit loading is not required.

 

The CLEAR function removes an SPL function from memory. CLEAR is very useful during function development to insure the function is executed with latest changes.