Progress
Version 9
Product Update Bulletin


Example 1 — Invoking an External Procedure Nonpersistently

The example p-diexm1.p dynamically invokes the external procedure hello.p nonpersistently.

p-diexm1.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. 
/* clean up */ 
DELETE OBJECT hCall. 

Example p-diexm1.p invokes the procedure file hello.p with a CHARACTER input parameter, the string "HELLO WORLD". The following fragment accomplishes the exact same thing statically:

RUN hello.p("HELLO WORLD"). 

This illustrates that dynamic invoke requires many more lines of code than does static invoke. For this reason, Progress Software Corporation recommends that you use dynamic invoke only when using static invoke is impossible.


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