开发者

why memo.loadFromFile takes so long time?

开发者 https://www.devze.com 2022-12-14 18:13 出处:网络
I use TMemo todisplay long strings. I was very surprised that method : Memo1.loadfromfile(\'mem.txt\') [mem.txt = 111 kB] took about 35 seconds, what is really really long time.

I use TMemo to display long strings. I was very surprised that method : Memo1.loadfromfile('mem.txt') [mem.txt = 111 kB] took about 35 seconds, what is really really long time.

How can I make TMemo load str开发者_运维知识库ings in real time?

thanx


Because WordWrap property was true...


:-) And you can try

try
  Memo1.Lines.BeginUpdate;
  Memo1.LoadFromFile('mem.txt');
finally
  Memo1.Lines.EndUpdate;
end;


You did not say which version of Delphi you are using. In Delphi 2009 and later, TStrings is now Unicode aware, and thus has to perform additional processing when non-Unicode (Ansi/UTF) encoded files are being loaded.

0

精彩评论

暂无评论...
验证码 换一张
取 消