Question

I am using Delphi Xe5 for both windows and Firemonkey mobile applications.

I have a unit I share among two different projects in my projects group. (Windows Application and a Firemonkey Mobile Application)

1.) How do I determine the version of Delphi Xe5 ? Or, what is the version?

2.) Is there a way to determine between a Win 32 application,. Win 64 Application, and Firemonkey mobile Application

3.) 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)

Thanks you

Was it helpful?

Solution

There is documentation about this topic

Q : How do I determine the version of Delphi Xe5 ? Or, what is the version?

A: Check the System.CompilerVersion constant. For XE5, CompilerVersion is 26. or you can use the VER260 conditional.

Q: Is there a way to determine between a Win 32 application,. Win 64 Application, and Firemonkey mobile Application.

A : Check the WIN32, WIN64 , ANDROID and IOS Predefined Conditionals.

Q : 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)

A: I Don't know what you mean.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top