Initializing MEMPTR variables using the SET-SIZE statement
- Last Updated: February 11, 2026
- 1 minute read
- OpenEdge
- Version 13.0
- Documentation
This is the syntax for the SET-SIZE statement:
Syntax
|
The value mptr-name is the name of a MEMPTR variable,
and expression is an integer expression specifying
the size, in bytes, of a memory region associated with mptr-name.
The value of expression can also be zero (0),
which frees any memory previously allocated to mptr-name.
ABL uses this size to perform bounds checking that ensures you do
not read or write to portions of memory outside of the specified
region.
If mptr-name is uninitialized (that is, defined
but not associated with any memory region) and expression is
greater than zero (0), the SET-SIZE statement allocates a
memory region whose size is specified by expression, and
associates it with mptr-name. If mptr-name is
already initialized and expression is greater
than zero (0), the SET-SIZE statement has no effect.
To resize memory allocated to a MEMPTR variable,
you must invoke SET-SIZE with an expression of
zero (0), then invoke SET-SIZE with an expression equal
to the new allocation.