load command

Use the load command to load (or reload) the file indicated by the current setting of the name parameter.

 

Syntax

load [ encoding charEncoding ]

 

Parameters

encoding charEncoding Use the optional encoding parameter to specify that the (new) character encoding of the file to be used is charEncoding.  If you specify an empty string (""), the editor tries to detect the file encoding by itself, and defaults to the native encoding if unsuccessful.  If not specified, the current encoding of the document's underlying file, if known, is used, otherwise the native (platform default) character encoding is used.

 

Status

The status parameter will be set to one of the following:

null Indicates that the load command successfully loaded the file.
file.incorrectEncoding Indicates that the load command could not load the file due to an incorrect encoding.
file.notFound Indicates that the load command could not locate the file.
file.errorReading Indicates that the load command encountered an error while reading the file.

 

Description

The load command clears the undo stack, resets the changes count, and issues updateProfile for all of the views of the current document.

 

Examples

load
load encoding UTF8 

Related concepts
Editor commands, actions, and parameters

Related reference
undo command
updateProfile command
changes parameter
dirty parameter
name parameter
reload action