错误 "RichEdit line insertion error!"

liuyb 2002-07-21 03:39:18
在使用richedit控件读入文件时的错误。
代码如下:
procedure readf(filea:string);
var
filet:filetext;
straa:string;
begin
assignfile(filet,filea);
reset(filet);
while not eof(filet)
begin
readln(filet,straa);
richedit1.lines.add(straa); //在此出错;
end;
closefile(filet);
end;
在很多机子上没问题,在一台win98se(刚安装)中出此错误,编程使用delphi6。delphi4也出同样的问题。因为要对文件进行分析不能使用 richedit1.lines.loadform('文件名')方式读入。我也知道是插入错误,但是为什么出错,在什么情况下会有这样的错误?
先谢过各位。
...全文
1760 11 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
liuyb 2002-07-27
  • 打赏
  • 举报
回复
这是我在网页上找到的资料,大家参考一下:
RichEdit line insertion error

Either your system is low on available resources or your source data contains unacceptable control characters (i.e. control characters, not ASCII text). Although this error message is rare, it does occur on older computers running Windows 95 and the First Edition of Windows 98. If you are running either of these operating systems, you should consider upgrading to Windows 98 Second Edition.

要不是您的系統可用資源過低,要不然就是來源資料裡含有不接受的控制字元 (如控制字元而非 ASCII 文字等)。此狀況並不常見,出現在舊版的 Windows 95, 98 第一版,因此建議考慮換成 98 第二版以上。


Philosophical Quotations for Windows - Known Errors

1. Reported 28/07/01 - Exception EReadError in module QUOTES.EXE at 00010F19. Error reading RichEdit2.Lines.Strings. RichEdit line insertion error.

This error message is due to a size limitation with richedit components for some versions of Windows. An exception error is raised when trying to insert text greater than 64KB. It has to do with the version of riched32.dll that you're using on your computer.

如大家没有什么问题的话,28号结分。
liuyb 2002-07-27
  • 打赏
  • 举报
回复
jishiping(JSP 季世平):你的办法解决了这个问题,但是为什么出错呢?
glink 2002-07-25
  • 打赏
  • 举报
回复
解决办法,就是不在dell的机上安装,或者给他升级到window98第二版(不过,我没做,dell的windows98是第一版的。
jishiping 2002-07-24
  • 打赏
  • 举报
回复
有些文字,插入到RichEdit时会产生这种错误信息,但是文字最终仍然插入到
RichEdit中了。所以,在插入时,用try拦截就可以了。
while not eof(filet)
begin
readln(filet,straa);
try
richedit1.lines.add(straa);
except
end;
end;
liuyb 2002-07-23
  • 打赏
  • 举报
回复
有人有新的想法吗?
liuyb 2002-07-23
  • 打赏
  • 举报
回复
哪位有新的想法?
liuyb 2002-07-22
  • 打赏
  • 举报
回复
TO:glink(飞天一狐)有没有解决方法?
glink 2002-07-21
  • 打赏
  • 举报
回复
这个问题我以前也出过,是在dell台式机上都这个样子。
liuyb 2002-07-21
  • 打赏
  • 举报
回复
没有包含控制字符,在其它的机子上正常。
Kingron 2002-07-21
  • 打赏
  • 举报
回复
经常碰到这种情况,请检查你的字符,是不是包含了控制字符?
netlib 2002-07-21
  • 打赏
  • 举报
回复
procedure readf(filea:string);
var
filet:filetext;
straa:string;
begin
if assignfile(filet,filea) then//如果成功在处理
begin
reset(filet);
Richedit1.lines.clear;//先清空
while not eof(filet)
begin
readln(filet,straa);
richedit1.lines.add(straa); //这里出错,你最好跟踪一下straa的值,可能读到了什么richedit产生误解的字符;//具体情况具体处理
end;
closefile(filet);
end;
end;

5,928

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧