[Lazarus] ComparePoints func

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Wed Jul 26 19:50:53 CEST 2017


On 2017-07-26 16:22, Michael Van Canneyt via Lazarus wrote:
> First start by defining what ComparePoints is supposed to measure or compare.

If "compare" doesn't mean "equals", then a better name should be used, 
otherwise that too is up for incorrect interpretation.



> 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?

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.

https://github.com/graemeg/fpGUI/blob/develop/src/corelib/fpg_base.pas#L160..L191



Regards,
   Graeme

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp


More information about the Lazarus mailing list