Forum Discussion

Azeddin_Margani's avatar
Azeddin_Margani
Contributor
8 years ago

When clicking YES button..

Hi,   I got message dialog displayed when the first part of the script is completed but i need to press YES button to continue to the next part of the script. When i press i press NO it should term...
  • Colin_McCrae's avatar
    8 years ago

    I don't use the built in Dialog's myself.

     

    But, looking at the docs for it: https://support.smartbear.com/testcomplete/docs/reference/program-objects/builtin/messagedlg.html

     

    ... it says it returns a constant relating to the button that was pressed?

     

    Your code is just checking for true or false, aka - a Boolean. Doesn't seem right to me? Try changing the post dialog check to check for the constant(s) instead .....

     

    ie -  if (k==mrYes)

     

    (Oh yeah - and in your else, you have a "break" statement before you print the log message. Which, I presume, means it will never get to the logging line?)