TMemo的Delphi属性行中的最大字符串长度 [英] Maximum Length of String in Delphi property Lines of TMemo

查看:763
本文介绍了TMemo的Delphi属性行中的最大字符串长度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找TMemo.Lines中String的最大长度为1024的原因,但尚未找到.

I've been searching the reason why the maximum length of String in a TMemo.Lines is 1024, but not found yet.

我有一个文本文件,其中包含定界的/csv数据,长度约为2000个字符. 在处理文件之前,我会使用备忘录对其进行预览.

I have a text file which contains delimited / csv data which length is around 2000 characters. I use a memo to preview it before I process the file.

memo.Lines.LoadFromFile(textFile);

memo.Lines.LoadFromFile(textFile);

我已将WordWrap设置为FALSE,并将scrollBar设置为ssHorizo​​ntal.因此,任何记录都不会被包装到下一行.

I have set the WordWrap to FALSE, and scrollBar to ssHorizontal. So any record will not be wrapped to the next line.

但是当我对备忘录行进行迭代时,我发现每个索引中的最大String保留为1KB或1024个字符.其余的将被截断到下一行.

But when I iterate the memo.Lines, I found that the maximum String hold in each index is 1KB or 1024 characters. The rest is truncated to the next line.

但是,如果我使用TStringList加载文件,则当该行超过1024个字符时,该行不会被截断到下一个索引.当我使用TRichEdit时不会发生这种情况.

But if I use TStringList to load the file, the row is not truncated to the next index when it reaches more than 1024 characters. This is not happen when I use TRichEdit.

  1. 任何人都可以解释这种现象吗?
  2. 这是TMemo的默认行为吗?

我用D2006尝试这个.

I use D2006 to try this.

推荐答案

WishKnew尝试此链接

WishKnew try this links

https://forums.embarcadero.com/thread.jspa?threadID=14035

http://www.borlandtalk.com/line-length -in-tmemo-vt67596.html

http://groups .google.com/group/borland.public.delphi.vcl.components.using/browse_thread/thread/318fe3240d2860ba

正如伟大的彼得·贝特(Peter Under)所说:

As the great Peter Below says :

...这与 出现行长度限制.这 极限实际上只是视觉上的,是由 控件呈现文本的方式.

...This has nothing to do with the appearend line length limit. This limit is really just visual, caused by the way the control renders its text.

再见.

这篇关于TMemo的Delphi属性行中的最大字符串长度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆