## ShowFileForEdit

### Introduced

v5.0

### Description

Opens the specified file in a floating text view. If the file is already being edited in a text view, ShowFileForEdit returns that view.
To avoid having too many floating windows open, ShowFileForEdit tries to re-use an existing text editor view.
If the "scripting.externaleditor" preference is set, ShowFileForEdit opens the file in the external text editor. The preference can contain %s and %l as placeholders for the filename and line number, for example "C:\Utils\MyEditor.exe /L:%l %s"

### Scripting Syntax

    oReturn = ShowFileForEdit( FileName, [LineNumber] );

### Return Value

A Text Editor or Script Editor View object

### Parameters

Parameter | Type | Description
--- | --- | ---
FileName | String | Full path to an existing file on disk
LineNumber | Integer | Line number to select in the file. The editor will scroll itself so that this line is in view. If not specified the file is opened at its beginning. Default Value: -1

### See Also

Layout.CreateView