Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to do a procedure when the date of a table changes 1

Status
Not open for further replies.

HowardHammerman

Instructor
Oct 11, 2001
640
US
I need to do a number of procedures in order. Some of the procedures are external to Foxpro. I call them using the run /n command.
The problem is that I don't want to call the external program until the internal programs are done. I can tell when they are done when the date of a particular table is equal to today's date.
How do I test for the event?

I am using VFP 6.0

Howard Hammerman,
Crystal Training and Crystal Material
On-site classes and one-on-one coaching
Low-cost telephone/email support
FREE independent Crystal newsletter
howard@hammerman.com
800-783-2269
 
In VFP 8 or later, you could use BindEvent() to bind to the system event you're looking for. In VFP 6, you'll have to use a timer that periodically checks for the condition you're interested in.

Subclass Timer, set Interval to the frequency with which you want to check (it's in milliseconds, so 1000 is once a second), and put code in the Timer event to do the checking. Something along these lines:

Code:
IF FDATE(aTheFile) = DATE()
   * Do what you need to
   This.Enabled = .F. && turn off the timer, so you can stop checking
ENDIF

Tamar
 
Thank you Tamar,

That is just what I wanted.

Howard

Howard Hammerman,
Crystal Training and Crystal Material
On-site classes and one-on-one coaching
Low-cost telephone/email support
FREE independent Crystal newsletter
howard@hammerman.com
800-783-2269
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top