Feedback mechanisms in VFP9 Reporting

I’m getting a bit confused here, so I’m going to talk it out a bit and see if I can clarify things for myself. Any mistakes here will be corrected ASAP, and should not reflect on my employer(s). :-)

There are two ReportListener methods called UpdateStatus() and DoStatus(). UpdateStatus fires with every page, and gives you the opportunity to call DoStatus with your own information. It then calls DoStatus with a “Rendering Page N” message, so you need a NODEFAULT if you’ve supplied your own information. Update: you can also call UpdateStatus whenever you want: it will not automatically call DoStatus in these cases.

When you call DoStatus with a string parameter, it gives you the string in a WAIT WINDOW NOWAIT — e.g., DoStatus("10%"). If you do this, you should use the ClearStatus() call when you’re done, to make sure that the window goes away.

There is also a DoMessage() method, which will pop up a messagebox. It takes the same parameters that the MESSAGEBOX() call does, but does not natively return any values.

If you set the AllowModalMessages property to .F., it will suppress the messagebox that pops up after any DoMessage call. It will not supress the code in DoMessage, even if you have a MESSAGEBOX() call there. You will need to test the property in DoMessage if this will be an issue.

There is also a QuietMode property, which will supress the native behaviors of DoStatus and DoMessage, but not the code within the methods.

So, you may need to do something like this.

IF NOT This.QuietMode
   IF This.AllowModalMessages
      MESSAGEBOX("Hi there!")
   ELSE
      WAIT WINDOW "Hi there!" NOWAIT
   ENDIF
ELSE
   * twiddle thumbs
ENDif

I think this is the way it all interacts: I’ll try to update as I discover where my clue is lacking. Sorry for the multiple versions so far….

Posted by Garrett on August 31st, 2004 in VFP | No Comments

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment