Consultor Eletrônico



Kbase P24559: Error (687) when explicitly passing buffer parameters to an external procedure (.p).
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   9/9/2006
Status: Unverified

SYMPTOM(s):

Attempting to compile a program that takes a buffer handle as an input parameter for a temp-table. e.g.:

DEFINE TEMP-TABLE tt NO-UNDO
FIELD f1 AS CHARACTER FORMAT "x(20)".

DEFINE PARAMETER BUFFER btt FOR tt.
IF AVAILABLE btt THEN
DISPLAY btt.f1.

** Shared buffers cannot be declared for nonshared workfiles. (687)

CAUSE:

This is a known issue.

FIX:

Use the persistent-mode call to accomplish this. For instance:

/*** p1.p ***/

DEFINE TEMP-TABLE tt NO-UNDO
FIELD f1 AS CHARACTER FORMAT "x(20)".
DEFINE VARIABLE vhP2 AS HANDLE NO-UNDO.
CREATE tt.
ASSIGN tt.f1 = "Hello World!".

RUN p2.p PERSISTENT SET vhP2.
RUN main IN vhP2 (BUFFER tt).

/*** p2.p ***/

DEFINE TEMP-TABLE tt NO-UNDO
FIELD f1 AS CHARACTER FORMAT "x(20)".

PROCEDURE main:
DEFINE PARAMETER BUFFER btt FOR tt.
IF AVAILABLE btt THEN
DISPLAY btt.f1.
END PROCEDURE.