Solved

MessageDlg wrong delphi type?

Posted on 2011-03-02
5
1,248 Views
Last Modified: 2012-05-11
MessageDlg(myinfo.totret, mtInformation, [mbOK], 0, mbOK);

Open in new window


myinfo.totret is type double

I get the following error:

There is no overload version of 'MessageDlg' that can be called with these arguments. I think it's because I'm using type double instead of type string in the MessageDlg code, not sure the easiest way to convert?

Thanks,
0
Comment
Question by:keats88
  • 3
5 Comments
 
LVL 32

Expert Comment

by:ewangoya
ID: 35018334

it needs a string

MessageDlg(FloatToStr(myinfo.totret), mtInformation, [mbOK], 0, mbOK)
0
 
LVL 32

Accepted Solution

by:
ewangoya earned 250 total points
ID: 35018364
Remove the last mbOK

Change this to
MessageDlg(FloatToStr(myinfo.totret), mtInformation, [mbOK], 0)

Open in new window

0
 

Author Comment

by:keats88
ID: 35018375
Perfect, thank you! This is my first attempt at a language that is strongly typed and it's presenting me some head aches, but will make my code better in the long run I suppose.
0
 
LVL 32

Expert Comment

by:ewangoya
ID: 35018387

Practice makes perfect, just hang in there
0
 
LVL 3

Expert Comment

by:KoenVandemoortel
ID: 35018405
For example:
MessageDlg(format('%g', [myinfo.totret]) , mtInformation, [mbOK], 0, mbOK);

Open in new window

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

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

895 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

15 Experts available now in Live!

Get 1:1 Help Now