Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5953271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:48:04+00:00 2026-05-22T17:48:04+00:00

Here is what I want to do. I have a project that must be

  • 0

Here is what I want to do. I have a project that must be compiled in some version of Delphi or later. I would like to use a conditional compiler directive to test the Delphi version, and then cause a custom compiler error to be generated with a custom message. Being able to generate a custom compiler warning or hint would also be adaquate if an error is not possible.

Sure, I could put some un-compilable giberish in the conditional code segment, and that’s fine. But my question is “Can I generate, conditionally, a custom compiler error?”


Thank you Johan and Serg.

Here is the solution, and more details about the issue. I have an application that was originally built in Delphi 2007. It includes Internet Direct components to attach to a Web service. These use SSL. I recently upgraded my SSL libraries to a later version, and these don’t play so well with the Delphi 2007 Indy components. I have now added the following compiler directives to ensure that this application will no longer be compiled with Delphi 2007 or earlier:

{$IF CompilerVersion <= 19.0} // Delphi 2007 = 19.0
   {$MESSAGE Error 'This project must be compiled in Delphi 2009 or later'}
{$IFEND}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T17:48:05+00:00Added an answer on May 22, 2026 at 5:48 pm

    You can use:

    {$Message HINT|WARN|ERROR|FATAL 'text string' } 
    
    
    
    {$MESSAGE 'Boo!'}                   emits a hint 
    {$Message Hint 'Feed the cats'}     emits a hint 
    {$messaGe Warn 'Looks like rain.'}  emits a warning 
    {$Message Error 'Not implemented'}  emits an error, continues compiling 
    {$Message Fatal 'Bang.  Yer dead.'} emits an error, terminates compiler 
    

    See: http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/devcommon/compdirsmessagedirective_xml.html

    This works in Delphi 6 and later.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

James here. I'm working on a site that I want to have the same
I want to be able to have default text like Enter content here... appear
Here's the issue: I have a list of App names that I want to
I have got this project that uses excel for some calculation. This excel is
Placing an image inside a Span (here : HtmlGenericControl ) programmatically Want to have
I want to have a page redirect to another. Here is the situation: I
Here i want to do UDP Socket programming in C. I have one device
I want to have a UIImage as a background image on a UIView. Here
I work for a travel agency, they have a website, from here they want
Here is what I want to achieve: I have RadGridView, let's call it gridView,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.