Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1396
  • Last Modified:

MessageDlg wrong delphi type?

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
keats88
Asked:
keats88
  • 3
1 Solution
 
Ephraim WangoyaCommented:

it needs a string

MessageDlg(FloatToStr(myinfo.totret), mtInformation, [mbOK], 0, mbOK)
0
 
Ephraim WangoyaCommented:
Remove the last mbOK

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

Open in new window

0
 
keats88Author Commented:
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
 
Ephraim WangoyaCommented:

Practice makes perfect, just hang in there
0
 
KoenVandemoortelCommented:
For example:
MessageDlg(format('%g', [myinfo.totret]) , mtInformation, [mbOK], 0, mbOK);

Open in new window

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now