Re: [fpc-pascal] for-in loop cast

2019-09-26 Thread Ryan Joseph
> On Sep 26, 2019, at 1:34 PM, Sven Barth via fpc-pascal > wrote: > > And we should probably add a proper TObject enumerator to TObjectList. > I just assumed that had to be there! I’ll make a generic replacement like Ben suggests. Regards, Ryan Joseph

Re: [fpc-pascal] for-in loop cast

2019-09-26 Thread Ben Grasset
On Thu, Sep 26, 2019 at 11:59 AM Ben Grasset wrote: > -snip- > I meant to change the last part of the revised code example to: for value in list do because obviously the pointer cast is no longer necessary in that case. ___ fpc-pascal maillist -

Re: [fpc-pascal] for-in loop cast

2019-09-26 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Do., 26. Sep. 2019, 17:37: > 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. > > var > list: TObj

Re: [fpc-pascal] for-in loop cast

2019-09-26 Thread Ben Grasset
On Thu, Sep 26, 2019 at 11:37 AM Ryan Joseph wrote: > 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. > Well, TObjectLis

[fpc-pascal] for-in loop cast

2019-09-26 Thread Ryan Joseph
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. var list: TObjectList; value: TObject; begin for pointer(value) in list d