Recent

Author Topic: overloading issues fpc3.2.2  (Read 1289 times)

jamie

  • Hero Member
  • *****
  • Posts: 7707
Re: overloading issues fpc3.2.2
« Reply #15 on: May 06, 2026, 11:34:32 pm »
I don't use the Tcolor anymore, I have a TColorRec and that was working until the app starting getting a little larger then the
compiler started doing this.
BTW, Delphi has TColorRec definitions too. And this is the new definitions used by colors (as clRed, clYellow, etc ...). This is generically compatible with the old code, but in the case of my last example the use of new standard color def. doesn't work at all, because it is seen by the compiler as an integer.

Currently I am using this for TColor replacement, I suppose I could even add many items to this for graphics functions that already exists in the libraries somewhere, but mark them as inline etc.

Code: Pascal  [Select][+][-]
  1. TColorRec = Record
  2.  Case Byte of
  3.  0:(R,G,B,A:Byte);
  4.  1:(C:GraphType.TGraphicsColor);
  5. End;                      
  6.  

This solves my Overloading issues along with some help of Function Generics.
Jamie
The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018