If You are Using the EXECUTE Function in a Program

The EXECUTE function uses a string containing a PV‑WAVE command as its argument. The command passed to EXECUTE is not compiled until EXECUTE itself is executed. At that time, you may see the Program data area full message if the data area is already full and EXECUTE tries to create a new variable or common block.

If this occurs, you have the following options:

If the program is a main program, then use .SIZE or .LOCALS to increase the size of the data area.

If the program is a function or procedure, then it is necessary to use the ..LOCALS compiler directive in the function or procedure. The ..LOCALS compiler directive creates additional data area space at runtime.

In general, if you use EXECUTE to create variables or common blocks in a function or procedure, then it is likely that you will need to use ..LOCALS. This is because the data area is compressed immediately after compiling to accommodate only the symbols that are known at compile time. Thus, if EXECUTE is used to create variables or common blocks, there may not be space for any new symbols to be created. The ..LOCALS command is discussed in the next section.

Using the ..LOCALS Compiler Directive

The syntax of the ..LOCALS compiler directive is:

..LOCALS local_vars  common_symbols

This command is useful when you want to place the EXECUTE function inside a procedure or function. EXECUTE takes a string parameter containing a PV‑WAVE command. This command argument is compiled and executed at runtime, allowing the possibility for command options to be specified by the user. Because the data area is compressed after compiling, there may not be enough room for additional local variables and common block symbols created by EXECUTE. The ..LOCALS command provides a method of allocating extra space for these additional items.

The ..LOCALS compiler directive is similar to the .LOCALS executive command, except for the following:

..LOCALS is only used inside procedures and functions.

Its arguments specify the number of additional local variables and common block symbols that will be needed at “interpreter” time (when the already-compiled instructions are interpreted).

It is used in conjunction with the EXECUTE function, which can create new local variables and common block symbols at runtime.