Delphi Error – E2119 Structure field identifier expected

Delphi Compiler Error

E2119 Structure field identifier expected

Reason for the Error & Solution

The inline assembler recognized an identifier on the right side of a ‘.’, but it was not a field of the record found on the left side of the ‘.’. One common, yet difficult to realize, error of this sort is to use a record with a field called ‘ch’ – the inline assembler will always interpret ‘ch’ to be a register name.

program Produce;

  type
    Data = record
      x : Integer;
    end;

  procedure AssemblerExample(d : Data; y : Char);
  asm
    mov  eax, d.y
  end;

begin
end.

In this example, the inline assembler has recognized that ‘y’ is a valid identifier, but it has not found ‘y’ to be a member of the type of ‘d’.

program Solve;

  type
    Data = record
      x : Integer;
    end;

  procedure AssemblerExample(d : Data; y : Char);
  asm
    mov  eax, d.x
  end;

begin
end.

By specifying the proper variable name, the error will go away.

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...