Consultor Eletrônico



Kbase P170570: ABL Essentials incorrectly states passing by-reference to external procedure is invalid
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   8/17/2010
Status: Unverified

SYMPTOM(s):

ABL Essentials incorrectly states passing by-reference to external procedure is invalid

The ABL Essentials book contains the section:
"You can only specify BY-REFERENCE on an internal procedure or user-defined function call, not
on a RUN of an external procedure. ... "

Passing dataset or temp-table BY-REFERENCE to an external procedure works without error

FACT(s) (Environment):

OpenEdge 10.2x
All Supported Operating Systems
OpenEdge Category: Language (4GL/ABL)

CAUSE:

Bug# OE00199217

CAUSE:

This is a documentation bug

FIX:

This functionality can be used safely.

Following code sample demonstrates the behavior. When run, both procedures will report the same handle for the temp-table which proves they operate on the same instance.

/* calling.p - run this procedure */
DEFINE TEMP-TABLE myTT NO-UNDO
FIELD myField AS CHARACTER.

CREATE myTT.
ASSIGN myField = "!".

MESSAGE TEMP-TABLE myTT:HANDLE VIEW-AS ALERT-BOX INFO BUTTONS OK.

RUN called.p (INPUT TABLE myTT BY-REFERENCE).
/* --- end calling.p --- */


/* called.p - this is called from calling.p */
DEFINE TEMP-TABLE myTT NO-UNDO
FIELD myField AS CHARACTER.

DEFINE INPUT PARAMETER TABLE FOR myTT.

MESSAGE TEMP-TABLE myTT:HANDLE VIEW-AS ALERT-BOX INFO BUTTONS OK.

FIND FIRST myTT.
DISPLAY myField.
/* --- end called.p --- */