楼上的,richedit.lines.add('....')中'....'不能长于255字符,请问该怎么办?

解决方案 »

  1.   

    可以利用 Setlength()函数来设置str1的长度,比如:
    var
      str1:string;
      File1:textfile;
    begin
      setlength(str1,1000);//该函数的用法可以查看帮助!
      assignfile(file1,'c:\11.txt');//11.txt的长度大于255,小于1000;
      reset(file1);
      readln(file1,str1);
     richedit1.Lines.Add(str1);
     label1.caption:=inttostr(length(str1));//检查str1的实际长度。
    end;
      

  2.   

    换一种方式:
    确定插入点:RICHEDIT1.SELSTART :=SOMEWHERE
    将字符串(不限长度):RICHEDIT1.SELTEXT:=STRING YOU NEED
    你的字串将插入到指定的位置