>I have a view set to Optimistic Table buffering that I run a calc routine on modifying at least 300+ records. The TABLEUPDATE() takes on average 10+ seconds so I want to display a progress bar so the user knows something is actually happening and how far along it is. This leads me to 2 questions:
>
>1. Is there a way to show the progress of a TABLEUPDATE(1,.T.) ?
>
>2. Is there a way to find out how many records where modified/appended? If so, I could use this count and GETNEXTMODIFIED() to update a progress bar.
>
>TIA
Colin,
You could do this in 2 passes. First use GetNextModified() to get the number of modified/appended records. Then use it for the tableupdate().
LOCAL lnMax, ;
lnNext, ;
i, ;
lnStep, ;
llToast
*-- set the lnMax to reflect the total amount of changed/modified records (not shown here)
*-- lnMax =
lnNext = GETNEXTMODIFIED(0)
i = 0
lnStep = MAX(INT( lnMax / 100), 1)
BEGIN TRANSACTION
DO WHILE lnNext # 0
GO (lnNext)
IF ! TABLEUPDATE()
llToast = .T.
EXIT
ENDIF
IF MOD ( i , lnStep) = 0
this.cProgressMeter1.RefreshDisplay(i, lnMax)
ENDIF
lnNext = GETNEXTMODIFIED(lnNext)
i = i + 1
ENDDO
this.cProgressMeter1.Reset()
IF llToast
ROLLBACK
TABLEREVERT(.T.)
ErrorMsg(this.cMsgUpdateFailed)
RETURN .F.
ELSE
END TRANSACTION
ENDIF
MESSAGEBOX(DONE_LOC, 64, APPNAME_LOC)