I tried
Code: Select all
var text = WStrings.LoadFromFile("filename.txt");
Code: Select all
ShowMessage(text);
Then I tried opening the file with MainApp.OpenFile and then using GetText, which worked, but 1) I'd prefer to read it in a "silent" mode, and 2) I'm not sure how to close a non-current document...
Then I tried TFileStream, but samples shown in the help file raised some errors -- first line
Code: Select all
TFileStream stream = TFileStream.Create("C:\\Test.txt");