var i,code:integer; scope:string; label again; begin again:scope:=inputbox('移动光标位置','请输入移动距离'0'); val(scope,i,code); if code<>0 then begin ShowMessage('你输入了一个错误的移动范围,请重新输入!'); goto again; end else adotable1.MoveBy(i);
对不起,我没说明白.不是用ado 而是bde,谢谢!
sorry 是向前,看成向后了Table1.MoveBy(n)
moveby在移到最后一条记录时会设eof为truetable1.moveby(n) if table1.eof then table1.first;
scope:string;
label again;
begin
again:scope:=inputbox('移动光标位置','请输入移动距离'0');
val(scope,i,code);
if code<>0 then
begin
ShowMessage('你输入了一个错误的移动范围,请重新输入!');
goto again;
end
else
adotable1.MoveBy(i);
if table1.eof then
table1.first;