4D v16.3

ALERT

Home

 
4D v16.3
ALERT

ALERT 


 

ALERT ( message {; okButtonTitle} ) 
Parameter Type   Description
message  String in Message to display in the alert dialog box
okButtonTitle  String in OK button title

The ALERT command displays an alert dialog box composed of a note icon, a message, and an OK button.

You pass the message to be displayed in the parameter message. This message can be up to 255 characters long. However, 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.” To change the title of the OK button, pass the new custom title into the optional parameter okButtonTitle. If necessary, the OK button width is resized toward the left, according to the width of the custom title you pass.

Tip: Do not call the ALERT 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.

This example displays an alert showing information about a company. Note that the displayed string contains carriage returns, which cause the string to wrap to the next line:

 ALERT("Company: "+[Companies]Name+Char(13)+"People in company: "+
 String(Records in selection([People]))+Char(13)+"Number of parts they supply: "+
 String(Records in selection([Parts])))

This line of code displays the following alert box (on Windows):

The line:

 ALERT("I'm sorry Dave, I can't do that.";"Alas!")

displays the alert dialog box (on Windows) shown:

The line:

 ALERT("You no longer have the access privileges for deleting these records.";"Well, I swear I did not know that")

displays the alert dialog box (on Windows) shown:



See also 

CONFIRM
DISPLAY NOTIFICATION
Request

 
PROPERTIES 

Product: 4D
Theme: Messages
Number: 41

This command can be run in preemptive processes

 
HISTORY 

Modified: 4D v6

 
ARTICLE USAGE

4D Language Reference ( 4D v16)
4D Language Reference ( 4D v16.1)
4D Language Reference ( 4D v16.2)
4D Language Reference ( 4D v16.3)