OK message

Command groupFlag affectedReversibleExecute on clientPlatform(s)
Message boxesNONOYESAll

Syntax

OK message
 
title
 
 ([
Icon
][,
Sound bell
][,
Cancel button
])
 {
message
}

Options

IconIf specified,the message displays an operating system specific icon
Sound bellIf specified,the system bell sounds when the command displays the message
Cancel buttonIf specified,the message has a cancel button

Description

This command displays the specified message and waits for the user to click the OK or Cancel button before continuing. Method execution is halted temporarily while the message box is displayed. The number of message lines displayed depends on your operating system, fonts and screen size. In the message text you can force a break between lines (a carriage return) by using the notation "//" or the kCr constant enclosed in square brackets, e.g. 'First line[kCr]Second line'. Also you can add a short title for the message box.

For greater emphasis, you can select an Icon for the message box (the default "info" icon for the current operating system), and you can force the system bell to sound by checking the Sound bell check box.

The message box displayed by this command has an OK button by default, but you can add a Cancel button by checking the Cancel button option. After executing an OK message, the flag is unchanged, but you can use the msgcancelled() function to detect if the user pressed the Cancel button.

You can use square bracket notation in the message text to display the current value of fields and variables.

Note - for JavaScript client-executed methods this command uses a standard alert() or confirm() dialog.

Example

# Open a Ok messsage dialog, if cancel is pressed

# abort printing

Calculate
 
lUserName
 as 
'My Name'

OK message
 
My Editor
 (
Icon
,
Cancel button
)
 {
Ready to print, press Ok to continue
}

If
 
msgcancelled
()

  
OK message
 
My Editor
 {
Printing aborted by user [
lUserName
]
}

  
Quit method
 

End If