Notification commands

The Notification commands are used to get the user's attention by displaying a message or making a sound.

Beep

The Beep command plays the system beep sound.

Sample code

Beep

DebugLog(message As String)

Displays the specified message in the Messages pane.

ShowDialog(Message As String, explanation As String, DefaultButtonCaption As String, CancelButtonCaption As String, AltButtonCaption As String, icon As Integer) As String

The ShowDialog command displays a dialog box on the screen. You can specify the message and determine the buttons and their text.

Notes

If you pass in an empty string to CancelButtonCaption or AltButtonCaption, then the button does not appear. Returns a String containing the caption of the button that was pressed.

Values for Icon are:

  • -1: No icon

  • 0: Note icon (App Icon on Mac)

  • 1: Caution icon (On Mac, App Icon is superimposed)

  • 2: Stop Icon (App Icon on Mac)

  • 3: Question Icon (App Icon on Mac)

Sample code

Display a simple dialog:

Var result As String
result = ShowDialog("Hello!", _
  "Is it me you're looking for?", _
  "Yes", "No", "", 1)

ShowURL(url As String)

Displays the URL in the default web browser.

Sample code

ShowURL("http://www.xojo.com")

Speak(text As String)

The Speak command speaks the supplied text.

Sample code

Say "hello":

Speak("Hello")