What is the result of pressing the red 'x' on a dialog

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
mileswilliams
Junior Coder
Posts: 24
Joined: Sun Jun 11, 2006 9:50 am

What is the result of pressing the red 'x' on a dialog

Post by mileswilliams » Thu Aug 02, 2007 10:40 am

I know it is a simple one, but I can't seem to find the answer.
When I press the x button, what output is produced ? What is the default value of that button.

Cheers guys.
don't be a chicken little

User avatar
JRL
Automation Wizard
Posts: 3501
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Thu Aug 02, 2007 12:55 pm

If you are running a modal dialog, one that is displayed by using:

Show>DialogName,result

The value of the variable "result" will be 2 after picking the "X" in the upper right hand corner of the dialog.

Running a non-modal dialog and using the line:

GetDialogAction>DialogName,result

The value of the variable "result" will also be 2 after picking the "X" in the upper right hand corner of the dialog.

Because picking the "X" is a cancel activity, it is a good idea to set the result value of any "Cancel" buttons in a dialog to be 2. For example:

Dialog>MyDialog
Width=250
Height=100
Top=200
Left=300
Button=Cancel,85,30,80,30,
2
EndDialog>MyDialog

Show>MyDialog,result

mileswilliams
Junior Coder
Posts: 24
Joined: Sun Jun 11, 2006 9:50 am

Post by mileswilliams » Thu Aug 02, 2007 2:56 pm

Just before you replied I had the brainwave to show the watchlist and see what appeared...

Funnily enough what you have mentioned is exactly the reason I was asking; I was making the cancel and x buttons have the same result.

Thanks JRL
don't be a chicken little

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts