Function LoadFileToString( const aFileName : string) : string
Function LoadFileToWideString( const aFileName : string) : widestring
procedure OnMapEvent(var Value:Variant);
var data : string;
begin
data := LoadFileToString('c:\test.txt'); // reads file into string
LogInfo('First five characters from file: ' + Copy(data, 1, 5));
end;
Loads the contents of file aFileName into a string. Also see SaveToFile.
Use the WideString version to handle Unicode characters.