Skip to main content
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.

FMX.TMSFNCMemo.hppPascalC++
function AddSourceFromFile(AFileName: string): TTMSFNCMemoSource; overload;
TTMSFNCMemoSource* __fastcall AddSourceFromFile(System::UnicodeString AFileName)/* 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.

FMX.TMSFNCMemo.hppPascalC++
function AddSourceFromFile(AFileName, AName: string): TTMSFNCMemoSource; overload;
TTMSFNCMemoSource* __fastcall AddSourceFromFile(System::UnicodeString AFileName, System::UnicodeString AName)/* 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.

FMX.TMSFNCMemo.hppPascalC++
function AddSourceFromFile(AFileName, AName: string; ALanguage: TTMSFNCMemoLanguage): TTMSFNCMemoSource; overload;
TTMSFNCMemoSource* __fastcall AddSourceFromFile(System::UnicodeString AFileName, System::UnicodeString AName, TTMSFNCMemoLanguage ALanguage)/* 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.