Solved

messagedlg question

Posted on 2002-05-14
4
597 Views
Last Modified: 2011-09-20
Hi there!
Something's wrong with the result of the messagedlg() function?

messagedlg('Text',mtConfirmation,[mbYes,mbNo],0)

gives me an integer result of 3 when pressing "Yes" in the dialog at runtime.
This should correspond to the constat "mrYes", but this has an integer value of 6 so

if (messagedlg('text',mtconfirmation,[mbyes,mbno,0)=mryes)
 then // Yes clicked

does not work properly.

Any ideas?

0
Comment
Question by:max-hb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 4

Author Comment

by:max-hb
ID: 7008361
In qcontrols.pas i found the following definition:
Const
  mrNone     = 0;
  mrOk       = mrNone + 1;
  mrCancel   = mrOk + 1;  
  mrYes      = mrCancel + 1;

... but still inttostr(mrYes)="6" ... strange
0
 
LVL 11

Accepted Solution

by:
robert_marquardt earned 50 total points
ID: 7008469
mrYes in qcontrols.pas has obviously the value 3. The mrYes constant of controls.pas has the value 6.
So you most probably have qcontrols and controls in your uses. That is wrong.
0
 
LVL 1

Expert Comment

by:jellison
ID: 7008474
In my source files:  (Delphi 3)

In Controls.pas

mrYes = idYes;

and in Windows.pas

IDYES = 6;

Which might explain why you get a 6.  Which version are you using?

John
0
 
LVL 4

Author Comment

by:max-hb
ID: 7008560
Yes, that's it!
Never do something like

uses controls,qdialogs;

It results in the problem I stated above.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

730 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