Link to home
Start Free TrialLog in
Avatar of mathes
mathes

asked on

problem with incompatible data types

Hi experts,

I have a problem with this procedure:

procedure TForm1.Button1Click(Sender: TObject);
var
  listitembuffer,colourbuffer: string;
  sl: tstringlist;
begin
  listitembuffer:=sl.strings[i];
  colourbuffer:=colourbuffer+listitembuffer;
  colourbuffer:=TrimColour(colourbuffer);
  edit1.text:=colourbuffer;
end;

The prototype of TrimColour is declared as:

 procedure TrimColour(var master: string);

Unfortunately, in the line

colourbuffer:=TrimColour(colourbuffer);


Delphi says:

"incompatible types "string" and "procedure", untyped pointer or untyped parameter."


Can you please tell me, why this line is not correct?

What must I do in order to copy the result of TrimColour to colourbuffer ?

With kind regards

Mathes

Avatar of kretzschmar
kretzschmar
Flag of Germany image

hi mathes

your trimcolour is a procedure not a function
change the line
colourbuffer:=TrimColour(colourbuffer);

to
TrimColour(colourbuffer);

meikl

Avatar of mathes
mathes

ASKER

Dear meikl,

yes, this is the solution. Easy, huh

Oh, I am such a big idiot...

With kind regards

Mathes
ASKER CERTIFIED SOLUTION
Avatar of kretzschmar
kretzschmar
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial