Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5d

Application v 5.25a

  

 

Chapter SixteenApplication (continued)

RunMenuFunction Function

Overview

The RunMenuFunction function executes a defined function from the main dispatcher with optional parameters.

Syntax/Parameters

Syntax

int = RunMenuFunction ( [handle hwView], int id | string code, [string parameters ] );

Parameters

hwView

An optional handle to a view to send the requested function. If omitted, the active view or frame depending on the function will receive the function request.

id

An int containing a function ID. Or;

code

A string containing a function code.

parameters

An optional string containing parameters specific to the function.

Return Value

An int containing a formatted error code as returned from the actual function or menu function the dispatcher. ERROR_NONE for no error, ERROR_FUNCTION_NOT_SUPPORTED if function could not be dispatched or any code from the actual function.

Remarks

Menu functions break into three basic categories: frame, frame component and view. Frame functions include items such as opening a file (“FILE_OPEN”) or setting preferences (“FILE_SETTINGS_QUERY”), while frame component functions are items such as Collaboration or Management View functions. Finally, View items are directed to a specific view and their functionality and availability will vary depending on the active or specified view.

Running view functions from the IDE without specifying a view handle or making a view active is difficult since the function will be directed back at the currently running script file.

Parameters are function-dependent and many functions do not accept parameters.

Some functions will load information into the Global Log Object and then display the data in an Information View tab. The RunMenuFunction function always clears the log prior to running the requested function, irrespective of whether the log is employed by the function.

See Appendix C — Menu Function Parameters specification for published parameters for various menu functions.

If the application desktop is not running, the function will fail by returning ERROR_CONTEXT.

When using in conjunction with operations that may leave an edit action open, programmers should close the operation prior to calling the menu function, particularly if the menu function will alter the target window. For example, using the SGML Object, making changes and then calling a menu function that may make further changes, could result in an error.

Related Functions:

Platform Support

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

Legato IDE