Cecil
19+ years progress programming and still learning.
Hi all.
The first example code works and I have no problems with it.
The second example is all most I identical except that I there is no array extent size specified for the chInputValue variable. I set the extent size of the variable after I have defined it.
Now when I run the second example code the chInputValue variable only imports the first entry in the export file.
Is this a BUG or is this the expected behaviour?
Please try the first example and then try the second example. Thanks.
Details:
OE 10.2ASP2
OS Linux and Windows.
The first example code works and I have no problems with it.
The second example is all most I identical except that I there is no array extent size specified for the chInputValue variable. I set the extent size of the variable after I have defined it.
Now when I run the second example code the chInputValue variable only imports the first entry in the export file.
Is this a BUG or is this the expected behaviour?
Please try the first example and then try the second example. Thanks.
Details:
OE 10.2ASP2
OS Linux and Windows.
Code:
/** 1st Sample Code. **/
DEFINE STREAM sOutput.
DEFINE STREAM sInput.
DEFINE VARIABLE chOutputValue AS CHARACTER NO-UNDO EXTENT 4 INITIAL ["CAT","DOG","RABBIT","RAT"].
DEFINE VARIABLE chInputValue AS CHARACTER NO-UNDO EXTENT 4.
OUTPUT STREAM sOutput TO 'extentexport.txt'.
EXPORT STREAM sOutput DELIMITER ',' chOutputValue.
OUTPUT STREAM sOutput CLOSE.
/* EXTENT(chInputValue) = EXTENT(chOutputValue). */
INPUT STREAM sInput FROM 'extentexport.txt'.
IMPORT STREAM sInput DELIMITER ',' chInputValue.
INPUT STREAM sInput CLOSE.
DEFINE VARIABLE i AS INTEGER NO-UNDO.
DO i = 1 TO EXTENT(chInputValue):
DISPLAY
i LABEL 'Extent'
chInputValue[i] LABEL 'Input Value'
WITH SIDE-LABELS .
PAUSE.
END.
Code:
/** 2nd Sample Code. **/
DEFINE STREAM sOutput.
DEFINE STREAM sInput.
DEFINE VARIABLE chOutputValue AS CHARACTER NO-UNDO EXTENT 4 INITIAL ["CAT","DOG","RABBIT","RAT"].
DEFINE VARIABLE chInputValue AS CHARACTER NO-UNDO EXTENT.
OUTPUT STREAM sOutput TO 'extentexport.txt'.
EXPORT STREAM sOutput DELIMITER ',' chOutputValue.
OUTPUT STREAM sOutput CLOSE.
EXTENT(chInputValue) = EXTENT(chOutputValue).
INPUT STREAM sInput FROM 'extentexport.txt'.
IMPORT STREAM sInput DELIMITER ',' chInputValue.
INPUT STREAM sInput CLOSE.
DEFINE VARIABLE i AS INTEGER NO-UNDO.
DO i = 1 TO EXTENT(chInputValue):
DISPLAY
i LABEL 'Extent'
chInputValue[i] LABEL 'Input Value'
WITH SIDE-LABELS .
PAUSE.
END.