Include Files - Named Parameters

OE 11.6 - Let's say I have a program sample.i which has below code snippet;

&IF DEFINED(test) = 2 &THEN
message "{&test}" view-as alert-box.
&ENDIF.

Now when I run below code; - let's say test.p

{sample.i
/* &test = yes */
}

Ideally I would not expect the message statement to be included in my test.p; but it gets executed and it gave me the value as 'yes' also.

If I remove the '&test = yes' then it works fine; isn't it same as that of commenting it?

It should definitely be a dumb question. It would be great if someone can help me in understanding this.
 
Works fine for me - try viewing the preprocessed file for clues as to why it is not working for you.
 
Thanks Stefan for your response. My bad - Yes this works.

Can you pls. check the below one? - this doesn't

{sample2.i
&t2_lock = NO-LOCK
/* &test = yes */
}

Now it doesn't. My Listing file looks weird too;

{} Line Blk
-- ---- ---
1
2 {sample2.i
3 &t2_lock = NO-LOCK
4 /* &test = yes */
5 }
1 1 &IF DEFINED(test) = 2 &THEN
1 2 message "{&test}yes" view-as alert-box.
1 3 &ENDIF.
5
6
D:\sample6.p 01/03/2017 05:48:43 PROGRESS(R) Page 2

File Name Line Blk. Type Tran Blk. Label
-------------------- ---- ----------- ---- --------------------------------
D:\sample6.p 0 Procedure No
 
Interesting, I see the same behavior, this smells like a bug to me. I can imagine quite some frustration tracking something like this down.
 
As discussed on Progress Communities, the issue here is trying to mix positional and named parameters. Once you use a named parameter, positional parameters cannot be used.
 
Back
Top