[fpc-pascal] fcl-passrc errors

Michael Van Canneyt michael at freepascal.org
Tue Oct 15 23:41:35 CEST 2019



On Tue, 15 Oct 2019, Benito van der Zander wrote:

> Hi,
>
> On 14.10.19 15:44, Ryan Joseph wrote:
>> var
>>    it: pointer;
>>    obj: TObject;
>> begin
>>    for it in list do
>>      begin
>>        obj := TObject(it);
>>        // continue on like before using “obj” instead of “it"
>>      end;
>> 
>> 
>> That’s our realistic best use case now but it requires 2 extra steps. I 
>> hope there’s a better solution to keep the for-in loops as easy to use as 
>> before.
>
> you could do
>
> var
>  it: pointer;
>  obj: TObject absolute it;
> begin
>  for it in list do
>    begin
>      // continue on like before using “obj” instead of “it"
>    end;

That's probably the best/easiest suggestion.

Michael.


More information about the fpc-pascal mailing list