Consultor Eletrônico



Kbase P51414: How to get the 'Yes' button of the MESSAGE statement to be t
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   31/10/2003
Status: Unverified

GOAL:

How to get the 'Yes' button of the MESSAGE statement to be the default response?

FIX:

When using the MESSAGE ... VIEW-AS ALERT-BOX BUTTONS YES-NO statement, the 'No' button will be the default button when the message box is displayed.  To make the 'Yes' button be the default button use code like the following:

DEFINE VARIABLE vDefaultButton AS LOGICAL NO-UNDO.

/* If you assign TRUE to vDefaultButton before executing the */
/* message statement, the 'Yes' button will be the default */
/* button. If you assign FALSE to vDefaultButton then the */
/* 'No' button will be the default button. */

ASSIGN vDefaultButton = TRUE.

MESSAGE 'Play With Default Button'
VIEW-AS ALERT-BOX BUTTONS YES-NO UPDATE vDefaultButton.

IF vDefaultButton = TRUE THEN
/* User Clicked the 'Yes' button */
ELSE
/* User Clicked the 'No' button */