Progress
Version 9
Product Update Bulletin


Example 3 — Using a CALL Object Multiple Times

Example, p-diexm3.p further demonstrates using a CALL object multiple times by doing the following:

  1. Dynamically invoking the procedure file hello.p with a CHARACTER input parameter, the string "HELLO WORLD"
  2. Dynamically invoking the external procedure persis.p persistently
  3. Dynamically invoking an internal procedure of persis.p, internal-persis-proc, with an input parameter of type INTEGER with the value 333
  4. p-diexm3.p
    DEFINE VARIABLE hCall AS HANDLE. 
      
    CREATE CALL hCall. 
    /*invoke hello.p nonpersistently */ 
    hCall:CALL-NAME = "hello.p". 
    /*sets CALL-TYPE to the default/* 
    hCall:CALL-TYPE = PROCEDURE-CALL-TYPE. 
    hCall:NUM-PARAMETERS = 1. 
    hCall:SET-PARAMETER( 1, "CHARACTER", "INPUT", "HELLO WORLD"). 
    hCall:INVOKE. 
    /* reset the CALL object handle */ 
    hCall:CLEAR. 
    /*invoke persis.p persistently */ 
    hCall:CALL-NAME = "persis.p". 
    /*sets CALL-TYPE to the default/* 
    hCall:CALL-TYPE = PROCEDURE-CALL-TYPE. 
    hCall:PERSISTENT = true. 
    HCall:INVOKE.   
       /* IN-HANDLE is automatically set
          to the handle of the persistent procedure
       */
                                              
    /* invoke internal-persis-proc in persis.p 
    HCall:CALL-NAME = "internal-persis-proc". 
    /*sets CALL-TYPE to the default/* 
    hCall:CALL-TYPE = PROCEDURE-CALL-TYPE. 
    hCall:NUM-PARAMETERS = 1. 
    hCall:SET-PARAMETER( 1, "INTEGER", "INPUT", 333). 
    hCall:INVOKE. 
    /* clean up */ 
    DELETE PROCEDURE hCall:IN-HANDLE. 
    DELETE OBJECT hCall. 
    

Example p-diexm3.p resets the CALL object handle by using the CLEAR() method between invoking hello.p (the first invoke) and invoking persis.p (the second invoke).


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