Project

General

Profile

Bug #4163

SHARED non-NEW buffer definitions must act as the equivalent of FIND or CREATE

Added by Greg Shah almost 5 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
Due date:
% Done:

100%

billable:
No
vendor_id:
GCD
case_num:
version_reported:
version_resolved:

History

#1 Updated by Greg Shah almost 5 years ago

SHARED non-NEW buffer definitions must promote the buffer and generally act as the equivalent of FIND or CREATE.

The idea here is that a shared buffer is one that already exists and which potentially already has a record that is available. This means that the 4GL compiler treats it as if a FIND or CREATE exists in the program. As of branch 4069a, FWD does promote the table and allow this to parse. That is the extent of the support. I suspect that this will need conversion changes. I don't know if it needs runtime changes.

testcases/uast/upstream-shared-buffer-user.p

def new shared buffer c-mer for customer.

find first c-mer.

run downstream-shared-buffer-user.p.

testcases/uast/downstream-shared-buffer-user.p

/* if this is missing then the use of customer below will generate: */
/* ** Missing FOR, FIND or CREATE for a table with customer in current block. (232) */
/* this means a non-new (imported) shared buffer is the equivalent of a FIND or CREATE */
def shared buffer c-mer for customer.

/* this is NOT the equivalent of a FIND or CREATE, it does not promote the buffer */
def new shared buffer p-test for p2j_test.

/* this is unambiguous because of the "imported" shared buffer */ 
if customer ne 0 or customer eq 0 then message "yep, customer.customer is a number (" + string(customer) + ")".
else message "WTF!".

#3 Updated by Greg Shah over 3 years ago

  • % Done changed from 0 to 100
  • Status changed from New to Closed

Also available in: Atom PDF