[Lazarus] Why is setlength not allowed?

Bo Berglund bo.berglund at gmail.com
Sun Nov 17 08:05:18 CET 2019


On Sat, 16 Nov 2019 11:50:45 +0100 (CET), Michael Van Canneyt via
lazarus <lazarus at lists.lazarus-ide.org> wrote:

>> I guess that the reason is that fpIoCtrl expects a pointer type
>> variable so the typecast is done... Is there no alternative?
>
>The warning seems correct. I suspect Pointer(iDevAddr) is probably wrong. 
>Maybe  Pointer(@iDevAddr)) is needed. I would need to see the original code.
>

I created my code by studying this on github:
https://github.com/tmssoftware/TMS-LCL-HW-Pack-for-Raspberry-Pi/blob/master/tmslclraspihw.pas

The "pointer" is on line 143

In any case it seems like it is working right now in real life. I can
read and write the i2c EEPROM device on my Raspberry Pi4.

And if the warning relates to porting this code to other platforms it
does not matter since it is destined for the RPi hardware and will not
be ported...


-- 
Bo Berglund
Developer in Sweden



More information about the lazarus mailing list