求助!!!谢谢!!
要求分屏显示学生.dbf中的所有记录,每屏记录数最多为20条,用户浏览完一屏按任意键继续下一屏,直到显示完所有记录,请编写程序。谢谢!!!!
20条为一循环结下,然后每一次要求输入任意键即可! Close All
Use 表
nPage=1
nPageTotal=Int((Reccount()-1)/20)+1
Do While .T.
Clear
?'字段1 字段2 字段3 ....'
Go Top
Skip (nPage-1)*20
For lnCnt=1 To 20
If Recno()<Reccount()
?字段1,字段2,字段3,....
Skip
EndIf
EndFor
?
?'请选择(PgUp上页/PgDn下页/Esc结束)'
nChoice=Inkey(60)
Do Case
Case nChoice=27 Or nChoice=0
Exit
Case nChoice=3 And nPage<nPageTotal
nPage=nPage+1
Case nChoice=18 And nPage>1
nPage=nPage-1
EndCase
EndDo
Return 如果是按任意键就显示下页,并且显示完毕就结束的话,上面程序修改为
Close All
Use 表
nPage=1
nPageTotal=Int((Reccount()-1)/20)+1
Do While .T.
Clear
?'字段1 字段2 字段3 ....'
Go Top
Skip (nPage-1)*20
For lnCnt=1 To 20
If Recno()<Reccount()
?字段1,字段2,字段3,....
Skip
EndIf
EndFor
?
?'请按任意键继续...'
nChoice=Inkey(60)
If nPage=nPageTotal
Exit
Else
nPage=nPage+1
EndIf
EndDo
Return
页:
[1]
