Solved

problem with incompatible data types

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

867 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

22 Experts available now in Live!

Get 1:1 Help Now