Pascal Scripting: MsgBox

Prototype:

function MsgBox(const Text: String; const Typ: TMsgBoxType; const Buttons: Integer): Integer;

Description:

Displays a message box. Text specifies the message to display. Typ specifies which icon to use in the message box. Buttons specifies which buttons to include in the message box. Returns an ID* constant indicating the button the user clicked, or 0 if the function fails (which shouldn't happen unless an invalid parameter is specified or system resources are exhausted).

Remarks:

TMsgBoxType is defined as:

TMsgBoxType = (mbInformation, mbConfirmation, mbError, mbCriticalError);

Example:
begin
  // Display a simple message box with an OK button
  MsgBox('Hello.', mbInformation, MB_OK);

  // Ask the user a Yes/No question
  if MsgBox('Are you sure?', mbConfirmation, MB_YESNO) = IDYES then
  begin
    // user clicked Yes
  end;

  // Ask the user a Yes/No question, defaulting to No
  if MsgBox('Are you sure?', mbConfirmation, MB_YESNO or MB_DEFBUTTON2) = IDYES then
  begin
    // user clicked Yes
  end;
end;