On 2016-06-16 16:49, Michael Van Canneyt wrote: > The return type of the GetEnumerator function tells you what the class is.
Actually, not quite. In the case of TJSONObject, it returns a base type enumerator: TBaseJSONEnumerator But if you look at the actual code of TJSONObject.GetEnumerator(), then you will notice that the actual type returned is TJSONObjectEnumerator. So by simply looking at the TJSONObject class interface you don't know the real type. Yes you could of course query it, but the return type is not obvious until you look at the actual implementation. > It is a good idea for a Lazarus IDE extension. Yes, I would imagine some IDE magic to code complete a for..in statement would be quite useful. But then is also shows how badly designed (again thanks to Delphi) the for..in statement is. It's not very friendly without "IDE magic". Regards, Graeme _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal