Consultor Eletrônico



Kbase P134015: Error 142 with variable initial values
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   7/13/2010
Status: Unverified

SYMPTOM(s):

Error 142 with variable initial values

Initial value code page conversion doesn't work in OE10

Unable to update Field (142)

Initial value segment is not correctly converted from the r-code code page to cpinternal.

UTF-8 r-code can fail with error 142 when it is run using a non UTF-8 session.

Extended characters in the initial value of a variable can cause error 142, if a code page conversion is necessary (e.g. from r-code code page to -cpinternal), when writing to a LONGCHAR.

For example, with the following code compiled to create UTF-8 r-code, if the code is run in a 1252 (-cpinternal) session, then error 142 will be displayed at run time.


DEFINE VARIABLE c AS CHARACTER NO-UNDO INITIAL "ABCé".
DEFINE VARIABLE d AS CHARACTER NO-UNDO.
DEFINE VARIABLE l AS LONGCHAR NO-UNDO.

d = "ABCé".
c = c.
/* fix-codepage(l) = "utf-8". */
l = c.

MESSAGE "C Init val : " c skip
"D : " d skip VIEW-AS ALERT-BOX INFORMATION.

FACT(s) (Environment):

All Supported Operating Systems
OpenEdge 10.1C

CAUSE:

Bug# OE00172728

FIX:

Upgrade to OpenEdge 10.2B01 or later.

Or alternatively:

- if the r-code code page is UTF-8 then use FIX-CODEPAGE to set the code page of the LONGCHAR to UTF-8.
- Use an assignment statement instead of INITIAL values.