Skip to content

LoadFileToWideString ​

LoadFileToWideString loads the contents of the file specified by aFileName into a string variable.

This function LoadFileToWideString handles unicode characters. For a similar function that does not accommodate unicode, please refer to LoadFileToString.

Declaration: Function LoadFileToWideString(const aFileName : string) : string

An example follows.

pascal
procedure OnMapEvent(var Value:Variant);
var vData : string;
begin
 //Reads file into string
  vData := LoadFileToWideString('C:\Temp\TodayTestWS.txt');
  LogInfo('First five characters from file: ' + Copy(vData, 13, 5));
end;