Question Does this code crash your openedge/progress session?

Cecil

19+ years progress programming and still learning.
Does the following code crash Progress/OpenEdge session when checking syntax?

I'm using OpenEdge 11.3.2 AppBuilder (32Bit) running on WINDOWS 7 PRO (64Bit). It's coded against the sports2000 database.

Code:
DEFINE VARIABLE hnDynaQuery      AS HANDLE      NO-UNDO.
DEFINE VARIABLE hnCustomerBuffer AS HANDLE      NO-UNDO.

CREATE BUFFER hnCustomerBuffer FOR TABLE 'Customers'.
CREATE QUERY hnDynaQuery.

hnDynaQuery:SET-BUFFERS(hnCustomerBuffer).
hnDynaQuery:QUERY-PREPARE('FOR EACH Customer').

hnDynaQuery:QUERY-OPEN().

IF hnDynaQuery:IS-OPEN THEN
DO:
    QUERY-LOOP:
    REPEAT:

        PROCESS EVENTS.

        hnDynaQuery:GET-NEXT(NO-LOCK).

        IF hnDynaQuery:QUERY-OFF-END THEN
            LEAVE QUERY-LOOP.

        ACCUMULATE DECIMAL(hnCustomerBuffer::CreditLimit) (AVERAGE MINIMUM MAXIMUM).

    END.
END.

hnDynaQuery:QUERY-CLOSE().

DELETE OBJECT hnDynaQuery.
DELETE OBJECT hnCustomerBuffer.

MESSAGE (ACCUM AVERAGE DECIMAL(hnCustomerBuffer::CreditLimit) ) SKIP
        (ACCUM MINIMUM DECIMAL(hnCustomerBuffer::CreditLimit) ) SKIP
        (ACCUM MAXIMUM DECIMAL(hnCustomerBuffer::CreditLimit) ) SKIP
    VIEW-AS ALERT-BOX INFO.
 
Confirmed, my client (OE 11.3.1 on windows) crashes when i do a syntax check on this code. :eek:

(also when i syntax check without any database connection)
 
Great, my client (OE 11.3.1 on windows) crashes even when i just do a syntax check on this code. :eek:
That's Great. Not just me then. It gets even weirder if you remove the DECIMAL functions.
I've got a Tech support case open. But they are having difficulties in reproducing the crash.
 
Same for OpenEdge 10.2B08 and Windows 7 Professional 64-bit. Crashes in the Procedure Editor and as Kris reported when connected or not connected to a database.
 
Same for OpenEdge 10.2B08 and Windows 7 Professional 64-bit. Crashes in the Procedure Editor and as Kris reported when connected or not connected to a database.

Technically it's dynamic code and the database is not actually needed at compile-time, it's only required at run-time.
 
Crashes my AppBuilder ( 11.3.1 ) too when syntax checking without any datase connection. My OS is W

To me, this does not look completely right in some way.

Hope that helps, RealHeavyDude.
 
In OE10 (10.2B06) it doesn't crash when you replace the dynamic reference to the CreditLimit field with a decimal variable. However, it does give a syntax error on your message (Unable to understand after bla bla bla). It looks like the problem is in doing the accumulate on the dynamic buffer and OE gets itself in a twist trying to work that out at compile time.

I also noticed that you do a for each Customer (singular) while your buffer is Customers (plural), but that has nothing to do with the problem at hand.

Code:
DEFINE VARIABLE hnDynaQuery  AS HANDLE  NO-UNDO.
DEFINE VARIABLE hnCustomerBuffer AS HANDLE  NO-UNDO.
DEFINE VARIABLE deDecimal  AS DECIMAL  NO-UNDO.
CREATE BUFFER hnCustomerBuffer FOR TABLE 'Customers'.
CREATE QUERY hnDynaQuery.
hnDynaQuery:SET-BUFFERS(hnCustomerBuffer).
hnDynaQuery:QUERY-PREPARE('FOR EACH Customer').
hnDynaQuery:QUERY-OPEN().
IF hnDynaQuery:IS-OPEN THEN
DO:
 
  QUERY-LOOP:
  REPEAT:
  PROCESS EVENTS.
  hnDynaQuery:GET-NEXT(NO-LOCK).
 
  IF hnDynaQuery:QUERY-OFF-END THEN
  LEAVE QUERY-LOOP.
  deDecimal = DECIMAL(hnCustomerBuffer::CreditLimit).
  ACCUMULATE deDecimal (AVERAGE MINIMUM MAXIMUM).
  END.
END.
hnDynaQuery:QUERY-CLOSE().
DELETE OBJECT hnDynaQuery.
DELETE OBJECT hnCustomerBuffer.
MESSAGE (ACCUM AVERAGE deDecimal ) SKIP
  (ACCUM MINIMUM deDecimal ) SKIP
  (ACCUM MAXIMUM deDecimal ) SKIP
  VIEW-AS ALERT-BOX INFO.
 
Back
Top