Have an amazing solution built in RAD Studio? Let us know. Looking for discounts? Visit our Special Offers page!
CodeDelphiIDERAD Studio

Delphi 11 Alexandria Defines

testdefinesinide

As part of my recent DelphiCon 2021 session, Multi-Platform Explorations using Delphi, FMX, Feeds, REST and More, my example code needed to use IFDEFs for some of the uses statements, variable definitions and code. This blog post contains an example of the use of defines when compiling for Windows (Win32/Win64), macOS, iOS and Android platforms. I also include screen shots of the sample output on each platform. You can download all of my talk’s sample projects using the session links above.

The simple Delphi FireMonkey application includes a TButton and a TMemo. In the Button’s OnClick event handler the code outputs information about the platform and the compiler defines for each platform.

testdefinesinide

Screen Grabs for Each Platform

android 64 defines ios15 1 defines macos 64 defines win32 defines win64 defines

Additional information can be found on the Delphi Wiki:

https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Conditional_compilation_(Delphi)

 

Interested in building an app that supports Android and Windows? Try out the Windows IDE and make the most of it. Start the Free Trial here.

See What's New in 12.2 Athens See What's New in 12.2 Athens Dev Days of Summer 2-24

Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.
Start Free Trial   Upgrade Today

   Free Delphi Community Edition   Free C++Builder Community Edition

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

IN THE ARTICLES