Search code examples
delphidelphi-xe2tlist

Delphi XE2 TPointerList usage


I have a following problem trying to compile some components in XE2. These components were not prepared for XE2, but I'm trying to compile them anyway.

Within a component it is declared like

FList : TList;

when used it is for example like

SomeVariable := Integer(FList.List^[i]);

It produces "Pointer type required" compile error.

I can be corrected it like this

SomeVariable := Integer(FList.List[i]);

but god knows how much time would I need to fix all occurencies of error.

Is there some compiler directive, or setting that can handle this. I've tried {$X} and {$T} without effect.

In XE2 Delphi TPointerList (TList.List property) is declared as dynamic array

type TPointerList = array of Pointer;

If anyone can help?


Solution

  • a) Integer(FList[i]) would also work.

    b) There is no such setting.

    c) Maybe you can Search&Replace .List^[ -> [ ?