How can we use pre-compiled commands to determine the Delphi version?

Source: Internet
Author: User

Use {$ ifdef ver1xx} to determine

// Delphi 4
{$ Ifdef ver120}
{$ Define vcl4orabve}
{$ Define vcl4o}
{$ Define Delphi}
{$ Define delphi4}
{$ Define overloading}
{$ Define optionalparams}
{$ Endif}

// C ++ Builder 4
{$ Ifdef ver125}
{$ Define vcl4orabve}
{$ Define vcl4o}
{$ Define cbuilder}
{$ Define cbuilder4}
{$ Define overloading}
{$ Define optionalparams}
{$ Endif}

// Delphi 5 & cbuilder 5
{$ Ifdef ver130}
{$ Define vcl4orabve}
{$ Define vcl5orabve}
{$ Define vcl5o}
{$ Ifdef BCB}
{$ Define cbuilder}
{$ Define cbuilder5}
{$ Else}
{$ Define Delphi}
{$ Define delphi5}
{$ Endif}
{$ Define overloading}
{$ Define optionalparams}
{$ Define sametext}
{$ Endif}

// Delphi 6
{$ Ifdef ver140}
{$ Define vcl4orabve}
{$ Define vcl5orabve}
{$ Ifdef BCB}
{$ Define cbuilder}
{$ Define cbuilder6}
{$ Else}
{$ Define Delphi}
{$ Define DELPHI6}
{$ Endif}
{$ Define overloading}
{$ Define optionalparams}
{$ Define sametext}
{$ Define vcl6orabve}
{$ Define vcl6o}
{$ Endif}

// Delphi 7
{$ Ifdef ver150}
{$ Define vcl4orabve}
{$ Define vcl5orabve}
{$ Ifdef BCB}
{$ Define cbuilder}
{$ Define cbuilder7}
{$ Else}
{$ Define Delphi}
{$ Define Delphi7}
{$ Endif}
{$ Define overloading}
{$ Define optionalparams}
{$ Define sametext}
{$ Define vcl6orabve}
{$ Define vcl7orabve}
{$ Define vcl6o}
{$ Define vcl70}
{$ Endif}

// Delphi 8
{$ Ifdef ver160}
{$ Define vcl4orabve}
{$ Define vcl5orabve}
{$ Ifdef BCB}
{$ Define cbuilder}
{$ Define cbuilder8}
{$ Else}
{$ Define Delphi}
{$ Define delphi8}
{$ Endif}
{$ Define overloading}
{$ Define optionalparams}
{$ Define sametext}
{$ Define vcl6orabve}
{$ Define vcl7orabve}
{$ Define vcl80rabove}
{$ Define vcl6o}
{$ Define vcl70}
{$ Define vcl80}
{$ Endif}

// Delphi 9
{$ Ifdef ver170}
{$ Define vcl4orabve}
{$ Define vcl5orabve}
{$ Ifdef BCB}
{$ Define cbuilder}
{$ Define cbuilder9}
{$ Else}
{$ Define Delphi}
{$ Define delphi9}
{$ Endif}
{$ Define overloading}
{$ Define optionalparams}
{$ Define sametext}
{$ Define vcl6orabve}
{$ Define vcl7orabve}
{$ Define vcl80rabove}
{$ Define vcl9orabve}
{$ Define vcl6o}
{$ Define vcl70}
{$ Define vcl80}
{$ Define vcl90}
{$ Endif}

// Delphi 10
{$ Ifdef ver180}
{$ Define vcl4orabve}
{$ Define vcl5orabve}
{$ Ifdef BCB}
{$ Define cbuilder}
{$ Define cbuilder10}
{$ Else}
{$ Define Delphi}
{$ Define delphi10}
{$ Endif}
{$ Define overloading}
{$ Define optionalparams}
{$ Define sametext}
{$ Define vcl6orabve}
{$ Define vcl7orabve}
{$ Define vcl80rabove}
{$ Define vcl9orabve}
{$ Define vcl1o0rabove}
{$ Define vcl6o}
{$ Define vcl70}
{$ Define vcl80}
{$ Define vcl90}
{$ Define vcl100}
{$ Endif}

{$ Ifdef Linux}
{$ Define vcl4orabve}
{$ Define vcl5orabve}
{$ Define overloading}
{$ Define optionalparams}
{$ Define sametext}
{$ Define vcl6orabve}
{$ Define vcl6o}
{$ UNDEF DELPHI6}
{$ Define kylix}
{$ Ifdef conditionalexpressions}
{$ 'If rtlversion = 14.0}
{$ Define kylix2}
{$ Ifend}
{$ 'If rtlversion = 14.50}
{$ Define kylix3}
{$ Ifdef BCB}
{$ Define bcbkylix3}
{$ Endif}
{$ Ifend}
{$ 'If rtlversion = 15.0}
{$ Define kylix4}
{$ Ifend}
{$ Endif}
{$ Endif}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.