Reputation: 305
I want to make a compile time test of a file. The set-up is as follow.
1. We have procedure files proc1.p, proc2.p, ... proc1000.p.
2. All procedure files proc1.p, proc2.p, ... proc1000.p have a common include file incl.i
I would like to have pre-process variable in incl.i that carries the name of the parent procedure in order to invoke different behaviour during compile time.
What I tried
/* incl.i */ &SCOPED-DEFINE procName {&FILE-NAME}
this does not work {&FILE-NAME} evaluates to the name of the include file.
Now, THIS-PROCEDURE:FILE-NAME holds the name of the procedure file, but it is not known at compile time.
Any ideas? I do not want to add a new input parameter to the include - thus updating proc1.p...proc1000.p.
Upvotes: 0
Views: 1135
Reputation: 14020
Pre-processors are the road to hell... but if you insist you could create an &GLOBAL-DEFINE in the parent procedure. Something like this:
/* parent.p
*/
&GLOBAL-DEFINE parentName {&FILE-NAME}
{include.i}
/* include.i
*/
display "{&parentName}".
Upvotes: 3