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

  • SEARCH
  • Home
  • 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 7071589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:42:23+00:00 2026-05-28T05:42:23+00:00

im working on application using delphi 7 , and i just came across this

  • 0

im working on application using delphi 7, and i just came across this

   {$A+,B-,C+,D+,E-,F-,G+,H+,I+,J+,K-,L+,M-,N+,O-,P+,Q-,R-,S-,T-,U-,V+,W-,X+,Y+,Z1}
   {$MINSTACKSIZE $00004000}
   {$MAXSTACKSIZE $00100000}
   {$IMAGEBASE $00400000}
   {$APPTYPE GUI}

   unit fmMain; // this is the main form of the project

   interface

   uses
     //..all the code is here
   end.  

i know there are these Compiler Directive and Delphi Compiler Directives list

the author of the code has placed the so many compiler directives before the main unit name.

can any one tell me

  1. Whats the use of having Directives before unit name, does this make them global?
  2. And can we create our own directives in some particular situations?
  3. where are the compiler directives defined?
  • 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-28T05:42:23+00:00Added an answer on May 28, 2026 at 5:42 am
    • The key topic explaining the principles is here: Delphi compiler directives.
    • The compiler directives are listed here: Delphi Compiler Directives (List).

    As to whether or not the directive has effect over the whole project, an entire unit, an single function and a region with a function, that varies from directive to directive. You have to read the documentation for each directive to know what its scope is.

    You ask if they need to be placed right at the start of the unit. You need to take account of the scope of the directive. Another part of the documentation has this to say regarding switch directives:

    Switch directives are either global or local:

    • Global directives affect the entire compilation and must appear before the declaration part of the program or the unit being compiled.
    • Local directives affect only the part of the compilation that extends from the directive until the next occurrence of the same directive. They can appear anywhere.

    However, consider the DENYPACKAGEUNIT directive (emphasis mine):

    The {$DENYPACKAGEUNIT ON} directive prevents the Delphi unit in which it appears from being placed in a package.

    If this directive has unit-wide scope then it merely needs to be present in the unit to take effect.

    So it can matter where the directive is placed. The bottom line is that, for each directive, you need to know its scope and in order to do so you must consult the documentation for that directive.

    Note that you only need to set directives in code if you wish to change the settings from those made in the project settings. It’s perfectly reasonable to set the options in the project options and not set them in code.


    What appears to have happened in the code you present is that the author typed CTRL+O O and the IDE inserted the various settings as defined in the project options at that instant in time.

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

Sidebar

Related Questions

Working on a console application using Delphi 7, and have run into a problem.
i am working in JSF Application and in this application using some code i
Im working on an application using Postgres 9 and Delphi 7 as the front
im working on an application using delphi 6 , where im trying to integrate
I am working on window application using c# . i want to show my
I'm currently working on web application using VB in ASP.NET. Right now I have
Greetings, I'm working in windows application using C#. I have typed-dataset called packetsDBDataSet and
Working on a tracking application using GPS. It is all fine, but sometimes because
I am working on a web application using Python (Django) and would like to
I am working on a winforms application using LINQ to SQL - and am

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.