2

I have a procedure structure like this:

<someprocedure.p>
    <randomCode>
    <INCLUDE standardIncludeFile.i>
</someprocedure>

The standardIncludeFile.i-include file can be used with any procedure files. However, it requires other include files to work. F.ex. stantarderror.i and standardconstants.i.

If the someprocedure.p already has included these 2 files, they shouldn't be included in the standardIncludeFile.i. If they're not, they should be included in the standardIncludeFile.i.

Can I use DEFINED inside the standardIncludeFile.i to check if those .i-files are already included in the someprocedure.p?

If I use INCLUDE anyway without any conditions, the Eclipse Open-Edge editor gives me the setting to include once, but I'm not sure if that's a good way. The files are compiled on the server for production, anyway.

Currently stantarderror.i or standardconstants.i do not contain any GLOBAL-DEFINED constants, so I cannot check them that way with DEFINED.

Mike Fechner
  • 6,627
  • 15
  • 17
W0lfw00ds
  • 2,018
  • 14
  • 23

1 Answers1

7

Within your incldue file, do something like this

&IF DEFINED (stantarderror) EQ 0 &THEN
GLOBAL-DEFINE stantarderror stantarderror


// actual code here


&ENDIF
Mike Fechner
  • 6,627
  • 15
  • 17