Try OpenEdge Now
skip to main content
ABL Reference
Handle Reference : TARGET-PROCEDURE system handle
 

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

TARGET-PROCEDURE [ :attribute | :method ]
attribute
An attribute of the TARGET-PROCEDURE handle.
method
A method of the TARGET-PROCEDURE handle.

Attributes

The 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.

Methods

The 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.

Examples

The 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:
1. A and B are handles of procedure files running persistently.
2. proc1 is an internal procedure that resides in B.
3. A says "RUN proc1 IN B," which runs B's proc1.
In this scenario:
*The original RUN statement for proc1 occurs in Step 3.
*Within proc1 (and any proc1 that runs as a result its original RUN statement), the value of TARGET-PROCEDURE is B.
Scenario 2: Using TARGET-PROCEDURE with procedure overriding
The following scenario uses TARGET-PROCEDURE with procedure overriding:
1. A, B, and C, and X are handles of procedure files running persistently.
2. B is a super procedure of A, and C is a super procedure of B.
3. proc1 is an internal procedure, different versions of which reside in A, B, and C.
Note: This is an example of procedure overriding.
4. X says "RUN proc1 in A," which runs A's proc1.
5. A's proc1 says "RUN SUPER," which runs B's proc1.
6. B's proc1 says "RUN SUPER," which runs C's proc1.
In this scenario:
*The original RUN statement for proc1 occurs in Step 4.
*Within any version of proc1 that runs as a result of the original RUN statement, the value of TARGET-PROCEDURE is A.
Scenario 3: With procedure overriding and additional complications
The following scenario uses TARGET-PROCEDURE with procedure overriding:
1. A, B, and C, and X are handles of procedure files running persistently.
2. B is a super procedure of A, and C is a super procedure of B.
3. proc1 is an internal procedure, different versions of which reside in B and C.
Note: proc1 does not reside in A.
4. X says "RUN proc1 in A," which runs B's proc1 (since A has no proc1 and B is a super procedure of A).
5. B's proc1 says "RUN SUPER," which runs C's proc1.
In this scenario:
*The original RUN statement for proc1 occurs in Step 4.
*Within any version of proc1 that runs as a result of its original RUN statement, the value of TARGET-PROCEDURE is A.
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:
1. A, B, and C are handles of procedure files running persistently.
2. B is a super procedure of A, and C is a super procedure of B.
3. proc1 is an internal procedure different versions of which reside in A, B, and C.
4. proc2 is an internal procedure different versions of which reside in A, B, and C.
5. A says "RUN proc1," which runs A's proc1.
6. 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.
7. B's proc1 says "RUN proc2," which runs B's proc2.
Note: This is a non-super RUN.
In this scenario:
*The original RUN statement for proc2 occurs in Step 7.
*Within any proc2 that runs as a result of its original RUN statement, the value of TARGET-PROCEDURE is B.
For a sample program that uses TARGET-PROCEDURE, see the reference entry for the RUN SUPER statement.

Notes

*You can use TARGET-PROCEDURE in applications that do not use super procedures.
*The value of TARGET-PROCEDURE becomes THIS-PROCEDURE in the following places:
*Within the main block of a procedure file.
*Within an internal procedure that is not a super version of another internal procedure.
*Within a user-defined function that is not a super version of another user-defined function.

See also

ADD-SUPER-PROCEDURE( ) method, REMOVE-SUPER-PROCEDURE( ) method, RUN SUPER statement, SOURCE-PROCEDURE system handle, SUPER function, SUPER-PROCEDURES attribute, THIS-PROCEDURE system handle