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:

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:

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:

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:

For a sample program that uses TARGET-PROCEDURE, see the reference entry for the RUN SUPER statement.

Notes

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