Establishing the Workspace

The workspace is a block of RAM reserved by PRO/5 to hold programs and data. The workspace is allocated in "pages" of RAM; each page is 256 bytes. The default start size for PRO/5 is 64 pages, or 16384 bytes (16K). Operations that overflow the workspace will cause an !ERROR=31, so it is important to allocate a large enough workspace.

Business BASIC developers traditionally establish a workspace size and work within that size. The maximum allowable size depends on the specific hardware and operating system.

Setting a Non-Default Workspace Size

There are two ways to set a non-default workspace size: using the –m command line switch when invoking PRO/5 and using the START verb.

Command Line Switch Method

The -m command line switch allocates the workspace when PRO/5 is invoked. The following command starts PRO/5 with a workspace of 1024 pages:

pro5 –m1024

START Verb Method

Using the START verb clears the existing program and data. For example, the following clears the existing workspace and allocates 1024 pages of RAM for the new workspace::

START 1024

Because the START verb clears the current program and data, BASIS recommends allocating the workspace only once and not reallocating it unless absolutely necessary. See the START verb documentation for more details.