Can I combine some IFDEFS in my source?
For example:
{$IFDEF INCOMING or OUTGOING}
...
{$ENDIF}
Thanks for your help: dd
Here's a variation of David's answer using 'not'.
I use this when I want to disable the splash screen on my apps while in debug mode. It prevents me from accidentally leaving the splash disabled if I forget to undefine NOSPLASH in the release build.
{$IF not (Defined(NOSPLASH) AND Defined(DEBUG))}
//code to create splash
{$IFEND}
Use $IF
with Defined()
rather than $IFDEF
:
{$IF Defined(INCOMING) or Defined(OUTGOING)}
...
{$IFEND}
Alternative, for older versions:
{$IFDEF INCOMING}
{$DEFINE INCOMING_OR_OUTGOING}
{$ENDIF}
{$IFDEF OUTGOING}
{$DEFINE INCOMING_OR_OUTGOING}
{$ENDIF}
{$IFDEF INCOMING_OR_OUTGOING}
...
{$ENDIF}
I don't believe the $IFDEF supports it, but the $IF does. http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/devcommon/compdirsifdirective_xml.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With