Site icon Embarcadero RAD Studio, Delphi, & C++Builder Blogs

Delphi 11 Alexandria Defines

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.


[crayon-6767929f27532863705235/]
Screen Grabs for Each Platform

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.

Exit mobile version