Set String and Stack Space

The Basic Control Engine has two regions of memory.

Memory Region

Description

String space

Holds all string variables, arrays, and public data.

 

Default String Space size

1 MB (1024 KB)

Stack space

Holds all local variables and intermediate values.

 

Default Stack Space size

4 KB

You can change the size of either of these spaces.

The changes apply to all Basic Control Engine scripts that run as executables within the Program Editor or from the Event Manager.

  1. Select Edit>Options on the Program Editor menu bar.

  2. The Options dialog opens.

  1. Enter the following.

Field

Description

String space

Number of kilobytes of String Space i

Stack space

Number of kilobytes of Stack Space

  1. Click OK.

A message opens as follows.

You must stop and restart CIMPLICITY for the changes to take effect.

  1. Click OK.

Notes

You can substantially reduce your stack usage by explicitly defining the types of variables (in other words, don't use variants).

Recursive routines have an impact on Stack Space.

If you use arrays or arrays of User Defined Types, allocation occurs in the String Space that may alleviate some stack usage.

More information

Program Editor window components.