1
votes

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?

1
No, you have to change the 3rd party code. Or get an update from the code vendor.David Heffernan
Also, your "correction" is incorrect. You mean: Integer(FList.List[i])David Heffernan
I think that you should never call an "Array of X" a "List", especially in a type declaration. Such confusion is only going to annoy people. TList-types have Add(x) methods, for instance, whereas Arrays are not object-types at all, and you have to SetLength, instead. Thus, "TSomethingList" is not a good name for an alias of "Array of Pointer".Warren P
@warren you should address that to the author of the code, embaDavid Heffernan
@david You are right about my "correction", I forgot to edit it, now its corrected here as well.Sofija

1 Answers

1
votes

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

b) There is no such setting.

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