Progress
Language Reference
SOURCE-PROCEDURE System Handle
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.
In this scenario:
Scenario 2: With Procedure Overriding
The following scenario uses SOURCE-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 Super and Non-super RUNs
The following scenario shows how the value of SOURCE-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 proc1 that runs as a result of its original RUN statement, the value of SOURCE-PROCEDURE is A.- B’s proc1 says “RUN SUPER,” which runs C’s proc1.
NOTE: This is a non-super RUN.- C’s proc1 says “RUN proc2,” which runs C’s proc2.
In this scenario:
SYNTAX
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.
EXAMPLEFor a sample program that uses SOURCE-PROCEDURE, see the reference entry for the RUN SUPER Statement in this book.
NOTES
- You can use SOURCE-PROCEDURE in applications that do not use super procedures.
- In the main block of a procedure, the value of SOURCE-PROCEDURE is the handle of the procedure that ran the current 4GL source code or r-code file. This allows any Progress program to identify its caller, and to perform a “callback” to its caller.
- If a 4GL or other client runs a procedure on a Progress AppServer, then in the procedure running on the AppServer, the value of SOURCE-PROCEDURE is UNKNOWN (?).
- For more information on super procedures and procedure overriding, see the Progress Programming Handbook .
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 |