Progress
Open Client
Developer’s Guide


4GL Procedures

The following procedure supports a small portion of an accounting system. The AccountInfo.p procedure is expected to run persistently and has an internal procedure called getPaymentsInfo.

AccountInfo.p
/* AccountInfo.p Procedure */
DEFINE INPUT PARAM account-num AS INTEGER.

DEFINE TEMP-TABLE payee-list       FIELD name          AS CHAR
                                   FIELD id            AS INTEGER.

DEFINE TEMP-TABLE payments-info    FIELD payment-date  AS DATE
                                   FIELD payee-id      AS INTEGER
                                   FIELD payee-name    AS CHAR
                                   FIELD amount        AS DECIMAL
                                   FIELD cleared       AS LOGICAL.

/* ... AccountInfo.p code ... */

/* The Internal Procedure getPaymentsInfo returns payment records. 
   This is information about payments done after a specific date to payees
   who belong to the payeeList set 
*/

PROCEDURE getPaymentsInfo:

    DEFINE INPUT  PARAM from-date AS DATE.
    DEFINE INPUT  PARAM TABLE FOR payee-list.
    DEFINE OUTPUT PARAM payments-num AS INTEGER.
    DEFINE OUTPUT PARAM TABLE FOR payments-info.

    /* ... getPaymentsInfo Code ... */

END PROCEDURE. 

Example 7–5: AppServer Application

Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095