PUBLIC oform1 oform1=NEWOBJECT("form1") oform1.Show RETURN DEFINE CLASS form1 AS form Top = 0 Left = 0 Height = 314 Width = 479 DoCreate = .T. Caption = "Form1" AllowOutput = .F. Name = "Form1" ADD OBJECT command1 AS commandbutton WITH ; Top = 16, ; Left = 26, ; Height = 27, ; Width = 178, ; Caption = "RecCount/2 ActiveRow", ; Alignment = 0, ; Name = "Command1" ADD OBJECT command2 AS commandbutton WITH ; Top = 16, ; Left = 224, ; Height = 27, ; Width = 178, ; Caption = "RecCount ActiveRow", ; Alignment = 0, ; Name = "Command2" ADD OBJECT grid1 AS grid WITH ; Height = 200, ; Left = 52, ; Top = 104, ; Width = 320, ; Name = "Grid1" ADD OBJECT command3 AS commandbutton WITH ; Top = 54, ; Left = 26, ; Height = 27, ; Width = 178, ; Caption = "RecCount/2 COUNT", ; Alignment = 0, ; Name = "Command3" ADD OBJECT command4 AS commandbutton WITH ; Top = 54, ; Left = 224, ; Height = 27, ; Width = 178, ; Caption = "RecCount COUNT", ; Alignment = 0, ; Name = "Command4" PROCEDURE Load CREATE CURSOR testGrid (f1 i) FOR k=1 TO 1000000 APPEND BLANK NEXT ENDPROC PROCEDURE command1.Click GO RECCOUNT()/2 thisform.grid1.Refresh && sync grid thisform.grid1.SetFocus && ActiveRow = 0 without Focus t1=seconds() FOR k=1 TO 10 =thisform.grid1.ActiveRow && eval next t1=SECONDS()-t1 this.Caption = GETWORDNUM(THIS.Caption,1,"=")+'= '+STR(t1,6,3) this.SetFocus ENDPROC PROCEDURE command2.Click GO RECCOUNT() thisform.grid1.Refresh && sync grid thisform.grid1.SetFocus && ActiveRow = 0 without Focus t1=seconds() FOR k=1 TO 10 =thisform.grid1.ActiveRow && eval next t1=SECONDS()-t1 this.Caption = GETWORDNUM(THIS.Caption,1,"=")+'= '+STR(t1,6,3) this.SetFocus ENDPROC PROCEDURE command3.Click GO RECCOUNT()/2 rn=RECNO() t1=seconds() FOR k=1 TO 10 COUNT ALL WHILE RECNO()#m.rn next t1=SECONDS()-t1 this.Caption = GETWORDNUM(THIS.Caption,1,"=")+'= '+STR(t1,6,3) ENDPROC PROCEDURE command4.Click GO RECCOUNT() rn=RECNO() t1=seconds() FOR k=1 TO 10 COUNT ALL WHILE RECNO()#m.rn next t1=SECONDS()-t1 this.Caption = GETWORDNUM(THIS.Caption,1,"=")+'= '+STR(t1,6,3) ENDPROC ENDDEFINE