一个特大的文本文件 不能用TStrings.loadfromfile来打开 现在用函数直接打开 代码如下
var str : string;
   f: System.TextFile;
begin
 try
   AssignFile(f, 'C:\example.txt');
   Reset(f);
   Seek(f, i);    //global var : i      initialize 0
   Readln(f,str);
   i:= i+length(str);
   closefile(f);
   showmessage(str);
 except
   raise;
 end;
seek那一句不能通过 求哪位大侠教教我 
目标是根据行号得到一行 并且可以方便的前后行读

解决方案 »

  1.   

    查查msdn,我记得有一个seek函数带好多参数的那种,是可以访问大文件的。
      

  2.   

    你的i是Integer吧?溢出了改为Int64试试
      

  3.   

    Type Range Format
    Integer ?147483648..2147483647 signed 32-bit
    Cardinal 0..4294967295 unsigned 32-bit
    Fundamental integer types include Shortint, Smallint, Longint, Int64, Byte, Word, and Longword.Type Range Format
    Shortint ?28..127 signed 8-bit
    Smallint ?2768..32767 signed 16-bit
    Longint ?147483648..2147483647 signed 32-bit
    Int64 ?^63..2^63? signed 64-bit
    Byte 0..255 unsigned 8-bit
    Word 0..65535 unsigned 16-bit
    Longword 0..4294967295 unsigned 32-bit
      

  4.   

    我怀疑文本文件能否用Seek?是否要其它结构的文件?