Solved

MessageDlg wrong delphi type?

Posted on 2011-03-02
5
1,264 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Simple Delphi Question 9 96
How to renew a Delphi rad-studio licence? 5 69
DBGrid or StringGrid ? 6 105
Wincontrol not (correctly) drawn 15 42
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

828 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