Can anyone help me to explain this Progress code?

aaronhome86

New Member
Dear all friend,

Could anyone help me on this?

I have some problem in understanding some part of this progress coding as highlighted as below:

&scoped b-dom-currency x-currency
&IF "{2}" = "" &THEN
DEFINE BUFFER {&b-dom-currency} FOR symcurr.currency.
&ENDIF

What is tat "{2}" mean? and why the buffer is define as "&b-dom-currency" but "not x-currency"?

&scoped b-eur-currency b-eur-currency
DEFINE BUFFER {&b-eur-currency} FOR symcurr.currency.

So why this &scoped got 2 same "b-eur-currency" but the previous one is different?
What is the usage of this
"&scoped b-eur-currency b-eur-currency" ?

I don't understand why using &scoped and how to use it?
Can anyone guide me through this?

Thanks and Best Regards,
Aaron.
 

RealHeavyDude

Well-Known Member
&SCOPED-DEFINE defines a pre-processor variable which is resolved at compile time. That is, at compile time the compiler takes x-currency as the value for the pre-processor variable {&b-dom-currency}.

{2} is an unnamed paramter passed to an include file (the second one).

The next piece of code is a compiler directive. That is the compiler will only compile the DEFINE BUFFER statement into the r-code if the second parameter passed to the include file is blank = not defined.

&IF "{2}" = "" &THEN
DEFINE BUFFER {&b-dom-currency} FOR symcurr.currency.
&ENDIF

The whole concept of pre-processor variables and directives is to conditionally compile code and thus making code more re-usable. Progress V6 - V9 are (in)famous for this technique :awink:.

HTH, RealHeavyDude.
 
Top