Consultor Eletrônico



Kbase 34443: How to export the value of a buffer-object handle to a file
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/10/1998
Solution ID: P4443

GOAL:

How to export the value of a buffer-object handle to a file

FACT(s) (Environment):

Progress 9.x

FIX:

The following code shows how to export the value of a buffer-object handle to a file. Please note that two versions of this code are shown below. The first version will work with all versions of Progress 9.1x and the second version will work with Progress 9.1D or later.


DEFINE VARIABLE hField AS HANDLE NO-UNDO.
DEFINE VARIABLE iLoop AS INTEGER NO-UNDO.
DEFINE VARIABLE iNumFields AS INTEGER NO-UNDO.

ASSIGN iNumFields = hSomeBufferObject:NUM-FIELDS.

DO iLoop = 1 TO iNumFields:
ASSIGN hField = hSomeBufferObject:BUFFER-FIELD(iLoop).
    EXPORT STREAM SomeStream hField:BUFFER-VALUE.
END.

/* Progress 9.1D and Later Version */

DEFINE VARIABLE iLoop AS INTEGER NO-UNDO.
DEFINE VARIABLE iNumFields AS INTEGER NO-UNDO.

ASSIGN iNumFields = hSomeBufferObject:NUM-FIELDS.

DO iLoop = 1 TO iNumFields:
    EXPORT STREAM SomeStream hSomeBufferObject:BUFFER-FIELD(iLoop):BUFFER-VALUE.
END.