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

Your email address will not be published. Required fields are marked *

You May Also Like

Delphi Compiler Error E2313 Attribute – Known attribute cannot specify properties Reason for the Error & Solution No further information...
Delphi Compiler Error E2379 Virtual methods not allowed in record types Reason for the Error & Solution No further information...
Rodrigo , one of the long time Delphi Developer has been working on one of his personal project “Delphi IDE...