Table of Contents

TTMSFNCMemoSources.AddSourceFromFile Method

Loads a new source buffer from a file, deriving the name and language from the file path, and appends it to the collection.

API unit family: TMSFNCMemo Declaring type: TTMSFNCMemoSources

Overloads

Overload 1

Loads a new source buffer from a file, deriving the name and language from the file path, and appends it to the collection.

function AddSourceFromFile(AFileName: string): TTMSFNCMemoSource; overload;

Parameters

Name Description
AFileName Path of the file to load as a new source buffer.

Returns

The newly created TTMSFNCMemoSource instance.

Overload 2

Loads a new source buffer from a file with an explicit name, deriving the language from the file extension, and appends it to the collection.

function AddSourceFromFile(AFileName, AName: string): TTMSFNCMemoSource; overload;

Parameters

Name Description
AFileName Path of the file to load as a new source buffer.
AName Display name assigned to the new source buffer.

Returns

The newly created TTMSFNCMemoSource instance.

Overload 3

Loads a new source buffer from a file with an explicit name and language mode, and appends it to the collection.

function AddSourceFromFile(AFileName, AName: string; ALanguage: TTMSFNCMemoLanguage): TTMSFNCMemoSource; overload;

Parameters

Name Description
AFileName Path of the file to load.
AName Display name assigned to the new source buffer.
ALanguage Syntax highlighting language applied to the new source.

Returns

The newly created TTMSFNCMemoSource instance.