Consultor Eletrônico



Kbase P111774: LONGCHAR parameter doesn't work in a recursive procedure
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   8/10/2006
Status: Unverified

FACT(s) (Environment):

OpenEdge 10.0B
OpenEdge 10.1A

SYMPTOM(s):

LONGCHAR parameter doesn't work in a recursive procedure

LONGCHAR parameter is mapped to an empty string when used inside a recursive procedure

Cannot use a LONGCHAR parameter in self-procedure call

The following piece of code shows the problem:
PROCEDURE test:
DEFINE INPUT-OUTPUT PARAMETER lcTest AS LONGCHAR.
DEFINE INPUT PARAMETER i AS INTEGER.

DEFINE VARIABLE cTest AS CHARACTER NO-UNDO.
cTest = lcTest.
MESSAGE cTest i
VIEW-AS ALERT-BOX INFO BUTTONS OK.

IF i < 3 THEN
RUN test(INPUT-OUTPUT lcTest, i + 1).

END.

DEFINE VARIABLE gcTest AS LONGCHAR NO-UNDO.
gcTest = 'Hallo'.

RUN test(INPUT-OUTPUT gcTest,0).

CAUSE:

Bug# 20051213-008

CAUSE:

Longchar parameters do not work correctly for recursively called procedures and functions: after the first recursive call the longchar parameters are set to an empty string

FIX:

Upgrade to 10.0B04,10.1A01,10.1B or later where this issue has been fixed.

A workaround would be:
To use a LONGCHAR global variable that you can use and modify in your recursive procedure without needing to use it as a parameter.