[fpc-pascal] fcl-passrc errors

Sven Barth pascaldragon at googlemail.com
Wed Oct 16 07:41:11 CEST 2019


Am 15.10.2019 um 23:46 schrieb Ryan Joseph:
>
>> On Oct 15, 2019, at 5:26 PM, Benito van der Zander <benito at benibela.de> wrote:
>>
>> 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 is a clever solution but it’s basically a sneaky trick around the compilers excessively strict typing. The programmer knows the correct type but there’s no way to tell that to the for loop.
Typecasting is a "sneaky trick around the compilers excessively strict 
typing" (sic!) as well. I personally use "absolute" very often when I 
want neither typecasts nor another temporary variable to clutter my code.

Regards,
Sven


More information about the fpc-pascal mailing list