vfp关于eof、bof的问题。
gotopskip-1?bof()这样答案是.T.是吗?gobottomskip1?eof()这样答案是.T.是吗?我的意思是想问,只是gotop(gobottom)是不...
go top
skip -1
?bof()
这样答案是.T.是吗?
go bottom
skip 1
?eof()
这样答案是.T.是吗?
我的意思是想问,只是go top(go bottom)是不能使?bof(?eof)为.T.的是吗?还需要skip 1(skip -1)的是吗? 展开
skip -1
?bof()
这样答案是.T.是吗?
go bottom
skip 1
?eof()
这样答案是.T.是吗?
我的意思是想问,只是go top(go bottom)是不能使?bof(?eof)为.T.的是吗?还需要skip 1(skip -1)的是吗? 展开
3个回答
展开全部
BOF是文件头,在表的第一条记录之前,EOF是文件尾,在表的最后一条记录之后
GO TOP:把记录指针移动到第一条,GO BOTTOM:把记录指针移动到最后一条
所以:
GO TOP
? BOF() &&返回.F.
SKIP -1 &&指针往上移一条
? BOF() &&返回.T.
GO BOTTOM
? EOF() &&返回.F.
SKIP &&指针往下称一条
? EOF() &&返回.T.
GO TOP:把记录指针移动到第一条,GO BOTTOM:把记录指针移动到最后一条
所以:
GO TOP
? BOF() &&返回.F.
SKIP -1 &&指针往上移一条
? BOF() &&返回.T.
GO BOTTOM
? EOF() &&返回.F.
SKIP &&指针往下称一条
? EOF() &&返回.T.
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
http://msdn.microsoft.com/en-us/library/28428ed2%28v=vs.80%29.aspx
If the record pointer is positioned on the last record of a table and SKIP with no arguments is executed, RECNO( ) returns a value 1 greater than the number of records in the table and EOF( ) returns true (.T.). If the record pointer is positioned on the first record of a table and SKIP –1 is executed, RECNO( ) returns 1 and BOF( ) returns true (.T.).
[这里的大概意思是说,如果当前记录指向最后一条记录,使用不带参数的SKIP,RECNO返回记录号+1,EOF返回TRUE,如果记录指向第一条记录,SKIP -1返回记录号1,BOF返回TRUE]
http://msdn.microsoft.com/en-US/library/7yk75h22%28v=VS.80%29.aspx
GO | GOTO命令的TOP 和BOTTOM参数:
TOP
Positions the record pointer on the first record in the table. If the table has an ascending index in use, the first record is the record with the lowest key value. If the index is in descending order, the first record is the record with the highest key value.
BOTTOM
Positions the record pointer on the last record in the table. If the table has an ascending index in use, the last record is the record with the highest key value. If the index is in descending order, the last record is the record with the lowest key value.
If the record pointer is positioned on the last record of a table and SKIP with no arguments is executed, RECNO( ) returns a value 1 greater than the number of records in the table and EOF( ) returns true (.T.). If the record pointer is positioned on the first record of a table and SKIP –1 is executed, RECNO( ) returns 1 and BOF( ) returns true (.T.).
[这里的大概意思是说,如果当前记录指向最后一条记录,使用不带参数的SKIP,RECNO返回记录号+1,EOF返回TRUE,如果记录指向第一条记录,SKIP -1返回记录号1,BOF返回TRUE]
http://msdn.microsoft.com/en-US/library/7yk75h22%28v=VS.80%29.aspx
GO | GOTO命令的TOP 和BOTTOM参数:
TOP
Positions the record pointer on the first record in the table. If the table has an ascending index in use, the first record is the record with the lowest key value. If the index is in descending order, the first record is the record with the highest key value.
BOTTOM
Positions the record pointer on the last record in the table. If the table has an ascending index in use, the last record is the record with the highest key value. If the index is in descending order, the last record is the record with the lowest key value.
参考资料: http://msdn.microsoft.com/en-US/library/7yk75h22%28v=VS.80%29.aspx
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询