Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5d

Application v 5.25a

  

 

Chapter FiveGeneral Functions (continued)

MessageBox Function

Overview

The MessageBox function displays a standard message box with the “OK” button or queries via the default console.

Syntax/Parameters

Syntax

int = MessageBox ( [int type], string message, [parameters ... ] );

Parameters

type

An optional int containing an icon type. This parameter can also contain a char value that resolves to an integer. The permissible values are:

  'I' MB_INFO Information
  'N' MB_NONE  None (no icon)
  'Q' MB_QUESTION Question
  'S' MB_STOP Stop
  'X' MB_EXCLAMATION Exclamation

 

The parameter selection does not change the buttons presented and type is not case-sensitive. See Message Box introduction for more information. The type is not used on console queries.

message

A string to display. If additional parameters are present, message is considered a formatted string. See Section 5.2 String Functions for more information on formatted strings.

parameters

Zero or more parameters to be formatted and inserted into message. If no parameters are supplied, message is simply passed through to the result string.

Return Value

Returns an int value as a formatted error code or a standard Windows ID code: IDCANCEL (2) or IDOK (1).

Remarks

Do not call the MessageBox function from background threads or the command line; it returns automatically without displaying the dialog. The MessageBox function supports a maximum of 4096 characters.

The MessageBox function permits the usage of a formatted string to display information. Formatted strings allow numeric and other data to be formatted into a string for appropriate display. The format of the string and the data to be inserted depend upon the structure of the message parameter and the contents of the additional parameters passed to the function. For more information on formatted strings, see Formatted Strings in Section 5.2 String Functions.

Scripts running as a background thread can call the MessageBox function, however the script will post a message to the application desktop frame for display by the primary thread. The MessageBox function will return immediately without having displayed the message box. The actual message box will be displayed at the first opportunity in the foreground when the primary thread is accepting messages. Therefore, if the primary thread is busy performing a task and messages are not being dispatched, the message box display will be delayed but the calling background thread will continue as if the user hit ‘OK’.

When running a console version of Legato, the message is dumped to the standard console output unless specifically overridden by the UseMessageBoxes function. The output will be prefixed with “Info:”, “Exclam:” or “Stop:” with the ‘i’,’x’ or ‘s’ icons respectively.

A simple message box does not pause execution when directed to the console.

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic