Solved

problem with incompatible data types

Posted on 1999-01-02
3
315 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
  • 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now