Progress
Language Reference
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.
The following scenarios illustrate using TARGET-PROCEDURE without procedure overriding, with procedure overriding, and with super and non-super RUNs:
Scenario 1: Without Procedure Overriding
The following scenario uses TARGET-PROCEDURE without procedure overriding:
In this scenario:
Scenario 2: 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.
NOTE: This is an example of procedure overriding.- proc1 is an internal procedure, different versions of which reside in A, B, and C.
- 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.
NOTE: proc1 does not reside in A.- proc1 is an internal procedure, different versions of which reside in B and C.
- 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.
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.- A’s proc1 says “RUN SUPER,” which runs B’s proc1.
NOTE: This is a non-super RUN.- B’s proc1 says “RUN proc2,” which runs B’s proc2.
In this scenario:
SYNTAX
attribute
An attribute of the TARGET-PROCEDURE handle. The TARGET-PROCEDURE handle supports all the attributes of the procedure handle. For a list of these attributes, see the reference entry for the THIS-PROCEDURE System Handle in this chapter.
method
A method of the TARGET-PROCEDURE handle. The TARGET-PROCEDURE handle supports all the methods of the procedure handle. For a list of these methods, see the reference entry for the THIS-PROCEDURE System Handle in this chapter.
EXAMPLEFor a sample program that uses TARGET-PROCEDURE, see the reference entry for the RUN SUPER Statement in this book.
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:
- For more information on super procedures, see the Progress Programming Handbook .
SEE ALSO
ADD-SUPER-PROCEDURE( ) Method, REMOVE-SUPER-PROCEDURE( ) Method, RUN SUPER Statement, SOURCE-PROCEDURE System Handle, SUPER Function, SUPER-PROCEDURES Attribute, TARGET-PROCEDURE System Handle
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |