delphicompiler-directivestms-web-core

How do I add a compiler directive for TMS Web Core websites?


I can use the following compiler directive code to specify Platform specific code:

{$IFDEF MSWINDOWS}
  // This code is for Windows
{$ENDIF}
{$IFDEF IOS}
  // This code is for iOS
{$ENDIF}
{$IFDEF MACOS}
  // This code is for MacOS
{$ENDIF}
{$IFDEF LINUX}
  // This code is for Linux
{$ENDIF}
{$IFDEF ANDROID}
  // This code is for Android
{$ENDIF}

That works for Windows, iOS, MacOS, Linux and Android.

I need to write TMS Web Core specific code now, but what is the compiler directive for TMS Web Core? Is there even one?


Solution

  • The compiler directive name for TMS Web Core is WEBLIB.

    So if you want to have code specifically for TMS Web Core, then you can write:

    {$IFDEF WEBLIB}
      // Code in here is for TMS Web Core
    {$ENDIF}
    

    Source: https://support.tmssoftware.com/t/project-compiler-directives-not-working/19858