HomeDelphiDelphi Error – E2573 Illegal value for the ALIGN directive (valid for one of 1, 2, 4, 8 or 16)

Delphi Error – E2573 Illegal value for the ALIGN directive (valid for one of 1, 2, 4, 8 or 16)

Delphi Compiler Error

E2573 Illegal value for the ALIGN directive (valid for one of 1, 2, 4, 8 or 16)

Reason for the Error & Solution

This occurs when you set the align directive to a value that is not in 1, 2, 4, 8, or 16.

program E2573;

{$APPTYPE CONSOLE}

uses
  SysUtils;

{$ALIGN 3}
type
  TAlignedRecord = Record
    name1   : string[4];
    floater : single;
    name2   : char;
    int     : Integer;
  end;
var
  alignedRec  : TAlignedRecord;
begin
   Writeln('Aligned record size = '+IntToStr(SizeOf(alignedRec)));
   readln;
end.

Share:

Leave a Reply

You May Also Like

Delphi Compiler Error X2421 Imported identifier ‘%s’ conflicts with ‘%s’ in ‘%s’ Reason for the Error & Solution This occurs...
Delphi Compiler Error X2367 Case of property accessor method %s.%s should be %s.%s Reason for the Error & Solution No...
Delphi Compiler Error X2269 Overriding virtual method ‘%s.%s’ has lower visibility (%s) than base class ‘%s’ (%s) Reason for the...