Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5b

Application v 5.24b

  

 

Chapter FiveGeneral Functions (continued)

ExitApplication Function

Overview

The ExitApplication function posts a quit application state and eventually unwinds the host application.

Syntax/Parameters

Syntax

int = ExitApplication ( );

Parameters

(none)

Return Value

Returns an int as ERROR_NONE or a formatted error code on failure. If the application is a console application, the function will return ERROR_FUNCTION_NOT_SUPPORTED.

Remarks

When running as the foreground process, ExitApplication sets a flag indicating that the application should forcibly terminate by posting a quit message to the application’s message queue after the calling script ends and its script engine is destroyed. The script will continue to execute to a normal exit point at which time the application will terminate. Edit windows are closed without saving or user warning.

Note that unless a script is explicitly run in the background using the RunBackgroundScript function, it is considered a foreground process.

If the function is run within a dialog box, the application will not exit until the script ends.

When running a script as a background thread, a close request is posted to the application frame and all dialogs and message boxes are inhibited.

When running as a console program, the ExitApplication function will fail and return an error. If the application does not has not displayed frame window or the message loop is not running, the function will fail and return an error.

Avoid using ExitApplication in any script that continues to remain active, such as, a hook or background process. The application exit is not processed until the script engine that processed the ExitApplication is destroyed..

If a runtime error occurs after execution of ExitApplication, the script will terminate and application will still exit.

The RunMenuFunction function can also be used with the FILE_EXIT menu code.

Related Functions

Platform Support

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

Legato IDE, Legato Basic