mathes
asked on
problem with incompatible data types
Hi experts,
I have a problem with this procedure:
procedure TForm1.Button1Click(Sender : TObject);
var
listitembuffer,colourbuffe r: string;
sl: tstringlist;
begin
listitembuffer:=sl.strings [i];
colourbuffer:=colourbuffer +listitemb uffer;
colourbuffer:=TrimColour(c olourbuffe r);
edit1.text:=colourbuffer;
end;
The prototype of TrimColour is declared as:
procedure TrimColour(var master: string);
Unfortunately, in the line
colourbuffer:=TrimColour(c olourbuffe r);
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
I have a problem with this procedure:
procedure TForm1.Button1Click(Sender
var
listitembuffer,colourbuffe
sl: tstringlist;
begin
listitembuffer:=sl.strings
colourbuffer:=colourbuffer
colourbuffer:=TrimColour(c
edit1.text:=colourbuffer;
end;
The prototype of TrimColour is declared as:
procedure TrimColour(var master: string);
Unfortunately, in the line
colourbuffer:=TrimColour(c
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
ASKER
Dear meikl,
yes, this is the solution. Easy, huh
Oh, I am such a big idiot...
With kind regards
Mathes
yes, this is the solution. Easy, huh
Oh, I am such a big idiot...
With kind regards
Mathes
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
your trimcolour is a procedure not a function
change the line
colourbuffer:=TrimColour(c
to
TrimColour(colourbuffer);
meikl