... example:
&IF DEFINE(PIPPO) = 0 &THEN
DEF SHARED VAR g-ses-id AS CHAR NO-UNDO.
&ENDIF
In this example the g-ses-id variable
will only be included if the PIPPO preprocessor has
been previously defined.
Correction: In this example the g-ses-id variable will only be included if the PIPPO preprocessor has NOT been previously defined.
This is used as a "sentinel" conditional to prevent code from being included in a particular program file more than once.
Tim is right. Thanks for the correction.
OK, tnx.
1]
I'm a dummie of the programmation, but what is with precision a "preprocessor expression"?
2]
Pippo in this example is a "preprocessor expression"?
Message was edited by:
matrixbob
Hi there,
As you mentioned you come from a C background. Preprocessor = Precompile statements
/* In Progress you do this */
&SCOPED-DEFINE PIPPO
&IF DEFINED( PIPPO ) &THEN
....
&ENDIF
/* In C you do this */
#define PIPPO
#ifdef PIPPO
....
#endif
Unfortunately Progress does not support C's macro functions (oh boy that would be nice to have ). On the other side, Progress has a wider range of Functions (ENTRY, LOOKUP,etc) as C.
Note that Progress implements two types of "defines" GLOBAL-DEFINE and SCOPED-DEFINE. Check the on-line help.
HTH
Unfortunately
Progress does not support C's macro functions (oh boy
that would be nice to have
However, they're moving the language to an increasingly C++ form...