RAD Studio Athens

E2190

Go Up to Error and Warning Messages (Delphi)

A thread local variable cannot refer to another variable, nor can it reference an absolute memory address.


program Produce;

  threadvar
     secretNumย : integer absolute $151;

begin
end.

The absolute directive is not allowed in a threadvar declaration section.


program Solve;

  threadvar
    secretNumย : integer;

  var
    sNumย : integer absolute $151;

begin
end.

There are two easy ways to solve a problem of this nature. The first is to remove the absolute directive from the threadvar section. The second would be to move the absolute variable to a normal var declaration section.