Solved

messagedlg question

Posted on 2002-05-14
4
599 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

729 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