SMAKE
NCHAR
The SMAKE instruction allows dynamic creation of a DIM or NCHAR character string variable. The greatest feature of SMAKE is that very large DIM or NCHAR variables may be created by a program once it loads into memory. This is accomplished without the disk space overhead the program would require if the variable were defined in the User Data Area (UDA). The instruction uses the following format:
|
|
|
|
|
Where:
label
Optional. A Program Execution Label.
dest
Required. A previously defined POINTER for the variable created.
size
Required. A previously defined Numeric Variable, Expression, or decimal constant indicating the size of the variable to create.
Flags Affected: ZERO
Note the following:
{dest} must be a DIM or NCHAR Pointer Definition or a compiler error occurs.
SMAKE attempts to create a character string variable of the specified size (blank-filled with both the Form Pointer and Length Pointer set to zero) using {dest} as its label.
If {size} equals zero or insufficient memory is available to create {dest}, the ZERO Condition Flag is set.
Variables created through SMAKE no longer exist after a ROLLOUT and must be recreated if they are referenced after a rollback operation.
Space allocated by an SMAKE instruction is not released until program termination. Performing a second SMAKE using the same pointer unlinks the pointer from the first memory allocation but does not free the memory for reassignment to another pointer.
DMAKE is similar to SMAKE except that the buffer allocation is performed using the operating system's memory allocation functions.
See Also: Example Code, Character String Instructions
![]() |