Re: [fpc-pascal] Iterating over elements from GetDynArrayProp

2022-10-15 Thread Michael Van Canneyt via fpc-pascal
On Sat, 15 Oct 2022, Hairy Pixels wrote: On Oct 15, 2022, at 3:03 PM, Michael Van Canneyt wrote: as far as I kbow, this should be ObjectArray := TObjectArray(GetDynArrayProp(AObject, PropertyInfo)); i.e. you get the actual array as a result. You’re right, I didn’t need that pointer cas

Re: [fpc-pascal] Iterating over elements from GetDynArrayProp

2022-10-15 Thread Hairy Pixels via fpc-pascal
> On Oct 15, 2022, at 3:03 PM, Michael Van Canneyt > wrote: > > as far as I kbow, this should be > ObjectArray := TObjectArray(GetDynArrayProp(AObject, PropertyInfo)); > i.e. you get the actual array as a result. > You’re right, I didn’t need that pointer cast. I’m still curious though why

Re: [fpc-pascal] Iterating over elements from GetDynArrayProp

2022-10-15 Thread Michael Van Canneyt via fpc-pascal
On Sat, 15 Oct 2022, Hairy Pixels via fpc-pascal wrote: How can I iterate over the pointer that is returned from GetDynArrayProp? I tried to cast it as a dynamic array of the element type but calling Length() on the returned value gave garbled data. For example with a property of the type “

[fpc-pascal] Iterating over elements from GetDynArrayProp

2022-10-14 Thread Hairy Pixels via fpc-pascal
How can I iterate over the pointer that is returned from GetDynArrayProp? I tried to cast it as a dynamic array of the element type but calling Length() on the returned value gave garbled data. For example with a property of the type “array of TObject": type TObjectArray = array of TObject;