Login
`
Templates, Tools and Utilities
|
||
Icetips Article
Back to article list
Search Articles
Add Comment
Printer friendly
Direct link
Templates: Extracting module names into variables 1998-10-22 -- Arnor Baldvinsson Newsgroups: comp.lang.clarion
Hi frc,
On Wed, 21 Oct 1998 22:39:00 GMT, frc@frontiernet.net wrote:
>We wish to find a function or compiler pragma which can return the
>module name (e.g., 'PROG003.CLW') in which it executes, something like
>MSVC's __FILE__ and __LINE__ functions.
>
>Any help greatly appreciated! Thanks.
This is very easy to do with extremely simple template code:
#TEMPLATE(ModuleExtensionTemplate,'Module template')
#EXTENSION(ModuleNameExtension,'Module name into variable'),PROCEDURE
#LOCALDATA
Loc:MET:ModuleName STRING(20)
#ENDLOCALDATA
#AT(%ProcedureInitialize)
Loc:MET:ModuleName = '%Module'
#ENDAT
Tested and it works.
Best regards,
Arnor Baldvinsson
Today is November 21, 2024, 3:59 am This article has been viewed 35211 times. Google search has resulted in 4 hits on this article since January 25, 2004.
|
|