Kbase P132520: 4GL/ABL: Given a multiple extent Array CHARACTER variable, does the 32K limit apply to the whole ar
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  9/18/2009 |
|
Status: Verified
GOAL:
4GL/ABL: Given a multiple extent Array CHARACTER variable, does the 32K limit apply to the whole array or to each of its individual extents?
GOAL:
If a CHARACTER variable is defined as an array with 10 extents, is the CHARACTER variable size limit of 32K applies to all 10 extents of the array or to each element of the array?
FACT(s) (Environment):
All Supported Operating Systems
Progress 8.x
Progress 9.x
OpenEdge 10.x
FIX:
The 32K limit (31991 characters) on the size of a CHARACTER variable applies to each individual extent (element) of an array CHARACTER variable. In other words, if a CHARACTER variable is defined as an array with 10 extents, then each element of the 10 extents of this variable will have a maximum size of 31991 characters (32K).
For example, the following code sample fills each of the 1000 array elements to the maximum size limit allowed for a CHARACTER variable - 31991 and then dumps the LENGTH of each of these 1000 array extents and its contents into a flat file:
DEFINE VARIABLE cArrayVariable AS CHARACTER NO-UNDO EXTENT 1000.
DEFINE VARIABLE iArrayIndex AS INTEGER NO-UNDO.
/* Fill each array element to the maximum size limit of a CHARACTER variable - 31991 */
DO iArrayIndex = 1 TO EXTENT(cArrayVariable):
ASSIGN
cArrayVariable[iArrayIndex] = FILL (CHR(iArrayIndex MODULO 26 + 65), 31991).
END.
/* Dump the length of each array extent and its contents into a flat file */
OUTPUT TO c:\wrk91e\myscratchfile.txt.
DO iArrayIndex = 1 TO EXTENT(cArrayVariable):
PUT UNFORMATTED
LENGTH (cArrayVariable[iArrayIndex]) " " cArrayVariable[iArrayIndex] SKIP.
END.
OUTPUT CLOSE.