FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Error: Impossible operator overload





adsmail27
Hi,

I'm using FPC 2.4.3

Why is the following operator overload not allowed? Sometimes
TfpgColor can be a RRGGBB value (eg: clRed), and sometimes it is an
index to a color palette (eg: clWindowBackground). So I want to do
comparisons between two such colors.

The compiler error I get:

..../programming/fpgui/src/corelib/fpg_main.pas(414,5Cool Error:
Impossible operator overload

The types are defined as follows:

type
TfpgColor = type longword;

TFPColor = record
Red: word;
Green: word;
Blue: word;
Alpha: word;
end;


... now the unit with the compiler error ...


interface section:

operator = (const AColor1, AColor2: TfpgColor) b: Boolean;


implementation section:

operator = (const AColor1, AColor2: TfpgColor) b: Boolean;
var
c1, c2: TFPColor;
begin
c1 := fpgColorToFPColor(AColor1);
c2 := fpgColorToFPColor(AColor2);
b := (c1.Red = c2.Red) and (c1.Green = c2.Green) and
(c1.Blue = c2.Blue) and (c1.Alpha = c2.Alpha);
end;
D'Artagnan
i think you would be better off in the programming forum
Related topics
FAQ : Comment installer Php-nuke, mambo et un forum phpbb?
Impossible parse error!
sms jokes
sms jokes
mobile programmers codes
Does the version of mysql used support...
Python
Do you believe in "LOVE at first SIGHT"?
[PHP] Parse error
Connect to a IP.
need help debugging C++ script.
autorun: nothing to choose?
If I need more than 250 mb...
Murder and Sex
Reply to topic    Frihost Forum Index -> Computers -> Computer Problems and Support

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.