E2119 Structure field identifier expected (Object Pascal)

From Appmethod Topics
Jump to: navigation, search

Go Up to Error and Warning Messages (Object Pascal) Index

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.