1

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?

Sofija
  • 713
  • 11
  • 14
  • No, you have to change the 3rd party code. Or get an update from the code vendor. – David Heffernan Jan 05 '12 at 12:41
  • Also, your "correction" is incorrect. You mean: `Integer(FList.List[i])` – David Heffernan Jan 05 '12 at 12:45
  • 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 Jan 05 '12 at 17:39
  • @warren you should address that to the author of the code, emba – David Heffernan Jan 05 '12 at 22:08
  • @david You are right about my "correction", I forgot to edit it, now its corrected here as well. – Sofija Feb 14 '12 at 23:59

1 Answers1

1

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

b) There is no such setting.

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

gabr
  • 26,580
  • 9
  • 75
  • 141
  • 1
    I will use Search & Replace like that. I just found out TList.List was changed in XE2, it was PPointerList prior to XE2 ... – Sofija Jan 05 '12 at 12:52