Programmer Guide > Writing Procedures and Functions > System Limits and the Compiler
  

System Limits and the Compiler
When a program is compiled (using .RUN, for example) output is directed to two areas: the code area and the data area. The code area holds internal instruction codes and the data area holds symbols for variables, common blocks, and keywords. If these areas become full, the compile is halted, and you will see one of the following messages:
Program code area full.
Program data area full.
Methods of handling these errors are discussed in the following sections.
Program Code Area Full
This message indicates that the code area (a block of memory that is allocated for use by the compiler to store instruction codes) has been exceeded. As a result, the compile cannot be completed. The method used to correct this condition depends on the type of program you are compiling:
If You are Compiling a Procedure or Function
There are two solutions:
*Break the procedure or function into smaller procedures or functions.
*Use the .SIZE executive command to increase the original size of the code area. The .SIZE command is described in Executive Commands in the PV‑WAVE Reference.
Compiling Main Programs
If you use .RUN or .RNEW to compile a file that contains statements that are not inside a function or procedure, and you receive the Program code area full message, you have these options:
*Use the .SIZE executive command to increase the original size of the code area. The .SIZE command is described in Executive Commands in the PV‑WAVE Reference.
*Place the statements that will be executed at the $MAIN$ level—those that are not contained in a procedure or function—into a file that does not contain any procedure or function definitions, then execute the program as a command file using the @ command. For example:
@filename
*The @ command compiles and executes the commands in the file one at a time, which does not require much code area space.
Program Data Area Full
This message indicates that the data area (a block of memory that is allocated for use by the compiler to store symbolic names of variables and common blocks) has been exceeded. As a result, the compile cannot be completed. The method used to correct this condition depends on the type of program you are compiling:
If You are Compiling a Procedure or Function
There are three solutions:
*Break the procedure or function onto smaller procedures or functions.
*Use the .SIZE executive command to increase the original size of the data area. The .SIZE command is described in Executive Commands in the PV‑WAVE Reference.
*Use the .LOCALS executive command to increase the original size of the data area. The .LOCALS command is described in Executive Commands in the PV‑WAVE Reference.
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 (note the second period) compiler directive in the function or procedure. The ..LOCALS compiler directive creates additional data area space at runtime.
 
note
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 compilation 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.

Version 2017.0
Copyright © 2017, Rogue Wave Software, Inc. All Rights Reserved.