Freigeben über


ClearStatus Method

Removes the interface elements provided by the DoStatus method.

oReportListener.ClearStatus()

Parameters

None.

Return Value

None.

Remarks

Applies To: ReportListener Object.

The DoStatus method provides modeless feedback for ReportListener objects. Since your program continues running after the DoStatus user interface elements appear, you need a way of removing these elements explicitly. The ClearStatus method provides this service.

Write appropriate code in this method to remove the interface elements your class provides in its DoStatus method. For example, the baseclass ReportListener uses a WAIT NOWAIT window to provide feedback during a report run, so the base class ReportListener ClearStatus method performs the equivalent of a WAIT CLEAR. The ReportListener User Feedback Foundation Class, in contrast, provides a progress bar in a form as report run feedback, so its ClearStatus method removes the form.

Important

Your user interface code should take the setting of the QuietMode property into account, emulating the behavior of the baseclass ReportListener. For more information, see DoStatus Method.

Example

You can invoke DoStatus and ClearStatus at any time, even when a report run is not in progress. In the following example, a ReportListener object adds some custom behavior if a DoStatus call occurs between report runs. When a report run begins, it clears any previous feedback that might be on-screen from any earlier call to DoStatus.

LOCAL oListener
oListener = CREATEOBJECT("messagingReportListener")
oListener.DoStatus()
REPORT FORM ? OBJECT oListener
oListener.DoStatus()
REPORT FORM ? OBJECT oListener
oListener.DoStatus()

DEFINE CLASS messagingReportListener AS ReportListener
   iReportRuns = 0
   ListenerType = 1
   PROCEDURE BeforeReport()
     THIS.iReportRuns = This.iReportRuns + 1
     THIS.ClearStatus()
     DODEFAULT()
   ENDPROC
   PROCEDURE DoStatus(cMessage)
      IF EMPTY(cMessage)
         NODEFAULT 
         DODEFAULT("You have run " + ;
                   TRANSFORM(THIS.iReportRuns) + " report(s) so far!") 
      ENDIF
   ENDPROC
ENDDEFINE

See Also

Reference

ReportListener Object
DoStatus Method
ReportListener User Feedback Foundation Class

Other Resources

Methods (Visual FoxPro)
Language Reference (Visual FoxPro)