SET-SIZE ( memptr-var ) = sizeAn integer expression that specifies the allocated byte size of the region pointed to by memptr-var.In the following example, the SET-SIZE statement allocates 8 bytes of memory, associates the memory with the ElipRegion variable, and then initializes the region with four SHORT (2-byte) values:
DEFINE VARIABLE ElipRegion AS MEMPTR NO-UNDO.ASSIGNSET-SIZE(ElipRegion) = 8
PUT-SHORT(ElipRegion, 1) = 10PUT-SHORT(ElipRegion, 3) = 10PUT-SHORT(ElipRegion, 5) = 200PUT-SHORT(ElipRegion, 7) = 50.
If memptr-var has no memory allocated to it (is uninitialized), then the SET-SIZE statement allocates a memory region of the specified size.
If the specified size is 0, the SET-SIZE statement deallocates (frees) any memory associated with memptr-var, making it available to reference a new memory region.
If the specified size is greater than 0 and memptr-var is fully initialized (associated with a memory region of a specified size), the SET-SIZE statement has no effect and leaves memptr-var unchanged.
For more information on accessing DLL routines from ABL, see OpenEdge Development: Programming Interfaces.
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates. |