Save Method

Saves the current screen as an nl file.

App.ActiveForm.Save(filePath)

Client support

   Newlook Smartclient only.

Version Support

Introduced in Version 11.0.10.

Parameters

filePath- (String, Required)

String value specifying the name (and optional path) of the file to be saved.

The path specified can be absolute or relative to the default Newlook solution folder.

If no file extension is specified in the filePath parameter, this method will add an '.nl' extension to the file. If an extension other than '.nl' is specified, it will be retained however '.nl' will be appended to the end of the file name (for example, 'errorScreen.txt' will become 'errorScreen.txt.nl').

If the file specified already exists, the existing file will be replaced.

Use

This method provides users with a mechanism to save the current screen as an nl file, without a dialog appearing.

Note:

This method cannot be used to save Added forms or OpenDSPF forms. Calling the Save method on one of these screens will return an empty string.

Returns

This method returns the final file path of the saved file. Any exception during this save action will generate a runtime error.

EXAMPLES

The following script saves the current screen as the file 'myScreen.nl' in the folder C:\NL Files.

J SCRIPT

function SaveScreen()

{

var savedFilePath = App.ActiveForm.Save("C:\\NL Files\\myScreen.nl");

}

 

The following script saves the current screen as an nl file, where it's name is derived from the current active form caption. The file will be saved in the default Newlook solution path.

J SCRIPT

function SaveScreen()

{

var screenName = App.ActiveForm.Caption;

var savedFilePath = App.ActiveForm.Save(screenName);

}

 

The following macros uses the RunMethod action to save the current screen as the file 'ErrorScreen.nl' in the default Newlook solution path.

MACRO ACTION

RunMethod(App.ActiveForm, Save, "ErrorScreen", vSavedFilePath)

See Also

Working offline with nl files | CaptureScreen method | Err object

Applies To

ActiveForm Object


© 2004-2021 looksoftware. All rights reserved.