I would like to know the OS type (Win 2K or Win XP) during the compile time. In my case, I have a procedure that runs in Windows 2000 and in Windows XP differently, and this procedure cannot compile in the other OS.
Example: I develop a procedure that only can compile and run in Windows XP. If I am developing in a Windows 2000 desktop and try to compile it, it gave me an error message.
Originally posted by Bruce A. Baasch
You can use the following to conditionally compile:
#If (yourcondition) Then
(yourcondition) must equate to a boolean True/False.
I don't know how to detect the operating platform during compilation, only during execution using the SysInfo control or API calls.
Thank you for your quick response, but via API call I know too. In my case, I need to write a code during the compilation. Using API call, when I compile the code, the Delphi compiler doesn't care if I'm running in the Win2k or WinXP.
I need to cut some line of code for Win2k or WinXP.