Home > Mobile >  In Delphi, what is a parameter directive?
In Delphi, what is a parameter directive?

Time:08-24

I am learning about different types of directives in Delphi. The documentation lists three types of directives: switch, parameter, and conditional.

However, the documentation gives a one-line vague description about parameter directives without giving any examples:

Parameter directives specify parameters that affect the compilation, such as file names and memory sizes. Delphi Directives

Can someone explain what are parameters in a directive and examples of a parameter directive.

Thank you so much!

CodePudding user response:

Linked page shows examples of parameters directives in common list:

{$I TYPES.INC}
{$M 32768,40960}

They are: including code piece from file TYPES.INC and setting minstacksize,maxstacksize memory sizes

You can see parameter directive (Resource file) in every VCL application:

implementation
{$R *.dfm}

You are right that help doesn't separate directives explicitly by these types (perhaps I've missed something)

In my mind, switch directives mostly contain switch /- or ON/OFF like $DEBUGINFO ON, while parameter ones require string/int parameters.

But $A: (Align fields) directive may contain both switch and alignment value, so I believe it is parameter directive, because /- are just synonyms for A1 and A8

  • Related