Progress
Programming
Handbook


Nesting Preprocessor References

During compilation, Progress recursively expands nested references, moving from the innermost reference to the outermost reference. To see how Progress expands nested references, look at the following procedure:

p-main.p
&GLOBAL-DEFINE X Y 
&GLOBAL-DEFINE Y Z 
&GLOBAL-DEFINE Z "Hello" 
DISPLAY {&{&{&{p-inclde.i}}}}.   

Progress expands the nested reference {&{&{&{p–inclde.i}}}} by starting with the include file p-inclde.i. For this example, p-inclde.i is as follows:

p-inclde.i
X 

Progress replaces {p–inclde.i} with the contents of p-inclde.i. After replacing {p-inclde.i} with X, Progress then has to expand the following nested reference:

DISPLAY {&{&{&X}}}. 

Progress expands this reference to the following code:

DISPLAY {&{&Y}}. 

This expands to the following code:

DISPLAY {&Z}. 

Finally, this expands to the following code:

DISPLAY "Hello". 

This last DISPLAY statement is the one that Progress finally compiles into your r-code.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095