Difference between &GLOBAL-DEFINE and &SCOPED-DEFINE

hungnx

New Member
Hi all,
I'm trying to understand the difference between two pre-processors &GLOBAL-DEFINE and &SCOPED-DEFINE( ex: Their scope), but i'm not found it yet. Can any one tell me that?

Thanks in advance,
Hung
 
The difference is rather simple. After a &GLOBAL-DEFINE the constant remains defined until the compiler finishes the current program. A &SCOPED-DEFINE constant remains defined until the compiler finishes the current file, ie. the constant is only propagated downwards in the include stack, not upwards.

Also, a &SCOPED-DEFINE constant hides a &GLOBAL-DEFINE constant with the same name.
 
Back
Top