Consultor Eletrônico



Kbase P140103: 4GL/ABL: READ-FILE() method fails to read the contents of text file into a form
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/15/2010
Status: Verified

SYMPTOM(s):

4GL/ABL: READ-FILE() method fails to read the contents of text file into a form.

ASSIGN statement and READ-FILE() method fail to read the data into a form.

EDITOR widget fails to DISPLAY the content of the file read by its READ-FILE() method.

Executing the following 4GL/ABL code under OpenEdge 10.1C, 10.1C01, 10.1C02, 10.1C03, 10.2A or 10.2A01 fails to DISPLAY the contents of the file in the EDITOR widget:
DEFINE VARIABLE cEditor AS CHARACTER NO-UNDO
VIEW-AS EDITOR SIZE 76 BY 10.
DEFINE VARIABLE lOk AS LOGICAL NO-UNDO.
FORM cEditor.
ASSIGN
lOk = cEditor:READ-FILE("C:\OpenEdge\WRK101C\W005140085\OE00180108.p")
cEditor.
DISPLAY cEditor.

FACT(s) (Environment):

Issue does not exist under OpenEdge 10.1A or 10.1B01
All Supported Operating Systems
OpenEdge 10.1C
OpenEdge 10.1C01 Service Pack
OpenEdge 10.1C02 Service Pack
OpenEdge 10.1C03 Service Pack
OpenEdge 10.2A
OpenEdge 10.2A01 Service Pack
OpenEdge Category: Language (4GL/ABL)
Content of the file is assigned sucessfully to a variable
Problem doesn't occur when using FRAME

CAUSE:

Bug# OE00180108

FIX:

Upgrade to OpenEdge 10.1C04, 10.2A02 or later. If upgrading to OpenEdge OpenEdge 10.1C04, 10.2A02 or later is not feasible, a workaround is to set the EDITOR widget MODIFIED attribute to true immediately after invoking its READ-FILE() method. For example:
DEFINE VARIABLE cEditor AS CHARACTER NO-UNDO
VIEW-AS EDITOR SIZE 76 BY 10.
DEFINE VARIABLE lOk AS LOGICAL NO-UNDO.
FORM cEditor.
ASSIGN
lOk = cEditor:READ-FILE("C:\OpenEdge\WRK101C\W005140085\OE00180108.p")
cEditor:MODIFIED = TRUE
cEditor.
DISPLAY cEditor.
Another workaround is to ENABLE the EDITOR widget after display DISPLAY editor statement. For example:
DEFINE VARIABLE cEditor AS CHARACTER NO-UNDO
VIEW-AS EDITOR SIZE 76 BY 10.
DEFINE VARIABLE lOk AS LOGICAL NO-UNDO.
FORM cEditor.
ASSIGN
lOk = cEditor:READ-FILE("C:\OpenEdge\WRK101C\W005140085\OE00180108.p")
cEditor.
DISPLAY cEditor.
ENABLE cEditor.