Consultor Eletrônico



Kbase P1254: 4GL. How to execute code based on Preprocessor values?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   3/12/2003
Status: Unverified

GOAL:

How to execute code based on Preprocessor values?

FACT(s) (Environment):

Progress 4GL

FIX:

It is possible using the Preprocessor to make a conditional compile of code.

In example, let's say that you want to compile code based on the DataBase you are connected.

The code below will show how to perform it.

TESP.P

IF CONNECTED("SPORTS2000") THEN
 {TEST.I &COMPILE = 1}


TEST.I

&IF "{&COMPILE}" = "1" &THEN
  COMPILE TEST1.P SAVE.
  RUN TEST1.P.
&END.

TEST1.P

FOR EACH CUSTOMER NO-LOCK:
    DISPLAY CUSTOMER.NAME.
END.