4D v13.4

CONFIRM

Home

 
4D v13.4
CONFIRM

CONFIRM 


 

CONFIRM ( message {; okButtonTitle {; cancelButtonTitle}} ) 
Parameter Type   Description
message  String in Message to display in the confirmation dialog box
okButtonTitle  String in OK button title
cancelButtonTitle  String in Cancel button title

The CONFIRM command displays a confirm dialog box composed of a note icon, a message, an OK button, and a Cancel Button.

You pass the message to be displayed in the message parameter. This message can be up to 255 characters long. If the message does not fit into the message area, it can appear truncated, depending on its length and the width of the characters.

By default, the title of the OK button is “OK” and that of the Cancel button is “Cancel.” To change the titles of these buttons, pass the new custom titles into the optional parameters okButtonTitle and cancelButtonTitle. If necessary, the width of the buttons is resized toward the left, according to the width of the custom titles you pass.

The OK button is the default button. If the user clicks the OK button or presses Enter to accept the dialog box, the OK system variable is set to 1. If the user clicks the Cancel button to cancel the dialog box, the OK system variable is set to 0.

Tip: Do not call the CONFIRM command from the section of a form or object method that handles the On Activate or On Deactivate form events; this will cause an endless loop.

The line:

 CONFIRM("WARNING: You will not be able to revert this operation.")
 If(OK=1)
    ALL RECORDS([Old Stuff])
    DELETE SELECTION([Old Stuff])
 Else
    ALERT("Operation canceled.")
 End if

will display the confirm dialog box (on Windows) shown here:

The line:

 CONFIRM("Do you really want to close this account?";"Yes";"No")

will display the confirm dialog box (on Windows) shown here:

You are writing a 4D application for the international market. You wrote a project method that returns the correct localized text from its English version. You have also populated an array named <>asLocalizedUIMessages,where you store the most common words. In doing so, the line:

 CONFIRM(INTL Text("Do you want to add a new Memo?");<>asLocalizedUIMessages{kLoc_YES};
 <>asLocalizedUIMessages{kLoc_NO})

could display the French confirm dialog box (on Windows) shown here:

The line:

 CONFIRM("WARNING: If your pursue this operation, some records will be "+"irremediably affected."+Char(13)+
 "What do you want to do?";"Do NOT continue";"Continue")

will display the confirm dialog box (on Macintosh) shown here:

 
PROPERTIES 

Product: 4D
Theme: Messages
Number: 162

The OK variable is changed by the command

 
INDEX

Alphabetical list of commands

 
HISTORY 

Modified: 4D v6

 
SEE ALSO 

ALERT
Request