30
ADDR Directive
Load & Lock Program in Memory
Format
ADDR prog_name$[, ERR=stmtref]
Where:
prog_name$ Name of the program to be loaded and kept in memory. String
expression. If you omit the pathname, ProvideX search rules apply.
stmtref
Program line number or label to transfer control to.
Description
The ADDR directive loads the specified program into memory and keeps it there
until you unload it.
For as long as the ADDR-loaded program is in memory, that specific program will be
referenced (using its absolute path) even if you change the system PREFIX or current
directory after executing the ADDR directive. That is, all subsequent references to
any program whose name matches that string will still refer to the ADDR-loaded
program.
You can see this in the example below. When the program is executed, ProvideX
ADDR-loads "DATECHK", changes directories and executes the ADDR-loaded
program even though there is a different current directory and a different program
with the same name might exist in that directory.
To unload a program which is ADDR-loaded, either use the DROP directive or
execute the START directive.
See also
Examples
0010
CWDIR "/opt/application/utilities"
0015
! /opt/application/utilities/datecheck is loaded in memory.
0020
ADDR "datecheck"
0025
! New working directory: could contain a different datecheck.
0030
CWDIR "/opt/application/ar"
0040
RUN "datecheck" ! Still runs /opt/application/utilities/datecheck