How do I determine the version of Delphi Xe5 ? Or, what is the version?
Use the CompilerVersion
and RTLVersion
constants. Refer to the documentation for more details.
Is there a way to determine between a Win 32 application,. Win 64 Application, and Firemonkey mobile Application
There is no way to differentiate between a VCL project and a FireMonkey project, and in fact it is possible (but not recommended) to mix VCL and FMX in the same project. As such, there is no project-specific conditionals defined by the compilers. However, what you should be doing instead is using IFDEF
and IFNDEF
statements in your code to target specific platforms, not specific project types. There are many platform-related conditionals defined by the various compilers: WIN32
, WIN64
, MACOS
, IOS
, ANDROID
, just to name a few (there are many more). Refer to the documentation for more details.
If you absolutely must differentiate between a VCL project and a FireMonkey project, you will have to go into the Project Options and define your own custom conditionals for that purpose.
In code, how do I tell the compiler which version of Dialogs to use based on the type of my app. That is VCL.Dialogs (Windows App) versus FMX.Dialogs (Firemonkey Mobile App)
The best option is to specify only Dialogs
by itself in your code, and then go into the Project Options and make sure that either Vcl
or FMX
is specified in the Unit Scope Names field. That will allow the compiler to choose between Vcl.Dialogs
and FMX.Dialogs
for you.