| View previous topic :: View next topic |
| Author |
Message |
Wayne & Carr Guest
|
Posted: Tue Mar 01, 2005 7:58 pm Post subject: Incompatible types: 'String' and 'TColor' |
|
|
How would I write this?
SearchColorIni := TIniFile.Create(ExtractFilePath(ParamStr(0)) + 'Data
FilesOptions.ini');
with SearchColorIni do begin
WriteString('Colors', 'SearchColor', SearchColors.Selected); // This line
gets the error
SearchColor := SearchColors.Selected;
end;
Right now I am getting the error
[Error] Project.pas(123): Incompatible types: 'String' and 'TColor'
Thanks All;
Wayne
|
|
| Back to top |
|
 |
Wayne & Carr Guest
|
Posted: Tue Mar 01, 2005 8:00 pm Post subject: Re: Incompatible types: 'String' and 'TColor' |
|
|
OOOOOOOps... :p
Meant to send this one to Components.Using..
Sorry people
Wayne
|
|
| Back to top |
|
 |
Rudy Velthuis [TeamB] Guest
|
Posted: Tue Mar 01, 2005 8:07 pm Post subject: Re: Incompatible types: 'String' and 'TColor' |
|
|
Wayne & Carr wrote:
| Quote: | How would I write this?
SearchColorIni := TIniFile.Create(ExtractFilePath(ParamStr(0)) +
'Data FilesOptions.ini');
with SearchColorIni do begin
WriteString('Colors', 'SearchColor', SearchColors.Selected); //
This line gets the error
SearchColor := SearchColors.Selected;
end;
Right now I am getting the error
[Error] Project.pas(123): Incompatible types: 'String' and 'TColor'
|
WriteString wants to write a string, but you obviously pass a TColor
(TColorBox.Selected is of type TColor). A TColor is an integer type, so
why don't you try to write an Integer:
SearchColorIni.WriteInteger('Colors', 'SearchColor',
SearchsColors.Selected);
--
Rudy Velthuis [TeamB] http://rvelthuis.bei.t-online.de
"Be tolerant of the human race. Your whole family belongs to it -- and
some of your spouse's family too." - Anonymous.
|
|
| Back to top |
|
 |
Wayne & Carr Guest
|
Posted: Tue Mar 01, 2005 8:38 pm Post subject: Re: Incompatible types: 'String' and 'TColor' |
|
|
Hello Rudy;
Thanks for the reply, even though I did submit to the wrong area.
Thanks for the information.
I am receiving the same error on this line as well
(After I added in the "WriteInteger" into the area's that was needed)
CoolBarColor := CoolBarColors.Selected;
&
CoolBarColors.Selected := CoolBarColor;
How would I write this out?
Thanks once again Rudy;
Wayne
|
|
| Back to top |
|
 |
Rudy Velthuis [TeamB] Guest
|
Posted: Tue Mar 01, 2005 8:51 pm Post subject: Re: Incompatible types: 'String' and 'TColor' |
|
|
Wayne & Carr wrote:
| Quote: | I am receiving the same error on this line as well
(After I added in the "WriteInteger" into the area's that was needed)
CoolBarColor := CoolBarColors.Selected;
&
CoolBarColors.Selected := CoolBarColor;
|
You should be able to find the problem by yourself. According to the
error message, the types don't match. Check the type of each of these
items (that is why you have an index in the online help), and see where
the mismatch is.
Followup set to borland.public.delphi.vcl.components.using.general
--
Rudy Velthuis [TeamB] http://rvelthuis.bei.t-online.de
"Room service? Send up a larger room."
-- Groucho Marx
|
|
| Back to top |
|
 |
|