[Lazarus] ComparePoints func
Sven Barth
pascaldragon at googlemail.com
Wed Jul 26 22:14:39 CEST 2017
Am 26.07.2017 19:51 schrieb "Graeme Geldenhuys via Lazarus" <
lazarus at lists.lazarus-ide.org>:
>> If "equals" is needed, why not simply use p1=p2 ?
>
>
> If operator overload exists for the types then sure, but as you know I
like OOP approaches to things.
>
> Also is TPoint a record or a object or a class?
It's an advanced record with methods and operator overloads:
https://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/rtl/inc/typshrdh.inc?revision=33062&view=markup
> In fpGUI the equivalent of TPoint and TRect are object types and has many
related methods defined inside them. I don't believe p1 = p2 is going to
work with the object data type.
For object types you'll need to declare global operator overloads to use
e.g. the = operator (which have the disadvantage that they don't work with
generics... at least not yet :/ ).
Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170726/9ead2c8a/attachment-0001.html>
More information about the Lazarus
mailing list