Progress
Language Reference


SOURCE-PROCEDURE System Handle

Interfaces
OS
SpeedScript
All
All
Yes

A handle to the procedure file that contains the original invocation (RUN statement or function invocation) of the current internal procedure or user-defined function.

The following scenarios illustrate using SOURCE-PROCEDURE without procedure overriding, with procedure overriding, and with super and non-super RUNs:

Scenario 1: Without Procedure Overriding

The following scenario uses SOURCE-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: With Procedure Overriding

The following scenario uses SOURCE-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.
  4. NOTE: This is an example of procedure overriding.

  5. X says “RUN proc1 IN A,” which runs A’s proc1.
  6. A’s proc1 says “RUN SUPER,” which runs B’s proc1.
  7. B’s proc1 says “RUN SUPER,” which runs C’s proc1.

In this scenario:

Scenario 3: With Super and Non-super RUNs

The following scenario shows how the value of SOURCE-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.
  7. B’s proc1 says “RUN SUPER,” which runs C’s proc1.
  8. NOTE: At this point, within any proc1 that runs as a result of its original RUN statement, the value of SOURCE-PROCEDURE is A.

  9. C’s proc1 says “RUN proc2,” which runs C’s proc2.
  10. NOTE: This is a non-super RUN.

In this scenario:

SYNTAX

SOURCE-PROCEDURE [ :attribute | :method ] 

attribute

An attribute of the SOURCE-PROCEDURE handle. The SOURCE-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 SOURCE-PROCEDURE handle. The SOURCE-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.

EXAMPLE

For a sample program that uses SOURCE-PROCEDURE, see the reference entry for the RUN SUPER Statement in this book.

NOTES

SEE ALSO

ADD-SUPER-PROCEDURE( ) Method, REMOVE-SUPER-PROCEDURE( ) Method, RUN SUPER Statement, 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