TARGET-PROCEDURE system handle
From within an internal procedure: A handle to the procedure file mentioned, explicitly or implicitly, by the original RUN statement that invoked (perhaps through a chain of super procedures) the current internal procedure.
From within a user-defined function: A handle to the procedure file mentioned, explicitly or implicitly, by the original function invocation that invoked (perhaps through a chain of super versions of functions) the current user-defined function.
Syntax
attribute
method
AttributesThe TARGET-PROCEDURE handle supports all the attributes of the procedure object handle. For a list of these attributes, see the reference entry for the Procedure object handle in this section.
MethodsThe TARGET-PROCEDURE handle supports all the methods of the procedure object handle. For a list of these methods, see the reference entry for the Procedure object handle in this section.
ExamplesThe following scenarios illustrate using TARGET-PROCEDURE without procedure overriding, with procedure overriding, and with super and non-super RUNs:
Scenario 1: Using TARGET-PROCEDURE without procedure overriding
The following scenario uses TARGET-PROCEDURE without procedure overriding:
In this scenario:
Scenario 2: Using TARGET-PROCEDURE with procedure overriding
The following scenario uses TARGET-PROCEDURE with procedure overriding:
- A, B, and C, and X are handles of procedure files running persistently.
- B is a super procedure of A, and C is a super procedure of B.
- proc1 is an internal procedure, different versions of which reside in A, B, and C.
Note: This is an example of procedure overriding.- X says “RUN proc1 in A,” which runs A’s proc1.
- A’s proc1 says “RUN SUPER,” which runs B’s proc1.
- B’s proc1 says “RUN SUPER,” which runs C’s proc1.
In this scenario:
Scenario 3: With procedure overriding and additional complications
The following scenario uses TARGET-PROCEDURE with procedure overriding:
- A, B, and C, and X are handles of procedure files running persistently.
- B is a super procedure of A, and C is a super procedure of B.
- proc1 is an internal procedure, different versions of which reside in B and C.
Note: proc1 does not reside in A.- X says “RUN proc1 in A,” which runs B’s proc1 (since A has no proc1 and B is a super procedure of A).
- B’s proc1 says “RUN SUPER,” which runs C’s proc1.
In this scenario:
Scenario 4: With SUPER and non-SUPER RUNs
The following scenario shows how the value of TARGET-PROCEDURE changes when a non-super RUN occurs:
- A, B, and C are handles of procedure files running persistently.
- B is a super procedure of A, and C is a super procedure of B.
- proc1 is an internal procedure different versions of which reside in A, B, and C.
- proc2 is an internal procedure different versions of which reside in A, B, and C.
- A says “RUN proc1,” which runs A’s proc1.
- A’s proc1 says “RUN SUPER,” which runs B’s proc1.
Note: At this point, within any version of proc1 that runs as a result of its original RUN statement, the value of TARGET-PROCEDURE is A.- B’s proc1 says “RUN proc2,” which runs B’s proc2.
Note: This is a non-super RUN.In this scenario:
For a sample program that uses TARGET-PROCEDURE, see the reference entry for the RUN SUPER statement.
NotesSee alsoADD-SUPER-PROCEDURE( ) method, REMOVE-SUPER-PROCEDURE( ) method, RUN SUPER statement, SOURCE-PROCEDURE system handle, SUPER function, SUPER-PROCEDURES attribute, TARGET-PROCEDURE system handle
OpenEdge Release 10.2B
|