Solved

problem with incompatible data types

Posted on 1999-01-02
3
323 Views
Last Modified: 2010-04-04
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

0
Comment
Question by:mathes
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1354245
hi mathes

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

to
TrimColour(colourbuffer);

meikl

0
 

Author Comment

by:mathes
ID: 1354246
Dear meikl,

yes, this is the solution. Easy, huh

Oh, I am such a big idiot...

With kind regards

Mathes
0
 
LVL 27

Accepted Solution

by:
kretzschmar earned 10 total points
ID: 1354247
hi mathes,

some problems are really easy, but sometimes the simple solution is not seen.

meikl
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question