{$A-} ,{$A+}

Belongs to : Compiler Directives


The $A compiler directive determines whether Delphi aligns data, or whether it packs the data into the smallest space. With $A+ (default), complex data types, such as records have their elements aligned to 2, 4 or 8 byte boundaries, as appropriate to the data type. For example, a Word field would be aligned to a 4 byte boundary. With $A+, the default value, you can override this setting with the packed option for complex data structures. These alignments ensure optimal access performance. $A- tells Delphi to ignore alignment, and thereby pack data.

Examples of unpacked alignments :
Word = 2 bytes
LongWord = 4 bytes
Single = 4 bytes
Double = 8 bytes
$Align is equivalent to $A.
This directive can be used multiple times within your code.
The default value is $A+

Example code

Related Commands

Compacts complex data types into minimal storage