[fpc-pascal] for-in loop cast

Ryan Joseph genericptr at gmail.com
Thu Sep 26 17:36:57 CEST 2019

Question I’ve always had. Why do I need to cast “value” to “pointer" otherwise I get: Incompatible types: got "Pointer" expected “TObject” error?. I don’t find this very helpful and it doesn’t really make sense even.

  list: TObjectList;
  value: TObject;
  for pointer(value) in list do

	Ryan Joseph

More information about the fpc-pascal mailing list