On 12-May-2014 08:21 -0500, David Gibbs wrote:
On 5/11/2014 6:28 PM, Helge Bichel wrote:
Hereby a procedure doing it. <<SNIP>>

That's the basic technique I was going to recommend (although the
code I have is in CL).

For the benefit of a reader, that technique was messaging; i.e. send a message to the caller and then Receive Message (RCVMSG) feature [the snipped text showed the QMHRCVPM API per non-CL code] used to retrieve the name from the program message queue of the prior call stack entry.

One thing to be aware of though ... if the running program is
replaced (and thus moved to QRPLOBJ), the program name will probably
change and a hard coded test will fail.

For user code that issue is typically easily overcome because the naming algorithm [the naming convention] is in conflict with "user"; i.e. the renamed program has the name prefix reserved for the OS, the letter 'Q'. Thus easy enough to review the program name, and if the program name starts with a Q, then Retrieve Object Description (RTVOBJD) to get the object TEXT information which has the original program name; i.e. beyond a naming convention, an additional convention is to replace the Object Information Record (OIR) text attribute with the original library and program name. Unless the program being called is an [effective] exit program [i.e. user code invoked by the OS or LPP code], the program name prefix should never be 'Q'.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.