1.在这段程序中seek()函数能给我具体解释一下它的使用吗!包括它的使用,和它的 
  参数.
2.seek(-getrecsize ,1)中(-getrecsize )为什么是负的?..........................
function trecordstream.getrecsize:longint;
begin
  result:=sizeof(tpersonrec);
end;
...............procedure trecordstream.first;
begin
seek(0,0);
end;procedure trecordstream.last;
begin
seek(0,2);
 seek(-getrecsize,1);
end;procedure trecordstream.nextrec;
begin
if ((position + getrecsize) div getrecsize)=getnumrecs then
   raise exception.create('cannot read beyond end of file')
else
   seek(getrecsize,1);
end;procedure trecordstream.previousrec;
begin
  if (position - getrecsize>=0) then
      seek(-getrecsize ,1)
  else
     raise exception.create('Cannot go beyond beginning of file');
end;

解决方案 »

  1.   

    负数就是从尾部往前seek
    参数1就是向前移1
      

  2.   

    Seek方法将流的当前指针移动Offset个字节,字节移动的起点由Origin指定。如果Offset是负数,Seek方法将从所描述的起点往流的头部移动。下表中列出了Origin的不同取值和它们的含义: 表20.1 函数Seek的参数的取值 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━  常量       值      Seek的起点 Offset的取值───────────────────────────────── SoFromBeginning 0  流的开头 正 数 SoFromCurrent 1 流的当前位置 正数或负数  SoFromEnd 2 流的结尾 负 数
      

  3.   

    那seek(0,2);和seek(0,0);是什么意思?