Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Stopping a process that is taking so long
Message
From
07/01/2005 15:43:03
Jean Haidar
Arkansas Blue Cross/Blue shield
Little Rock, Arkansas, United States
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00974828
Message ID:
00975249
Views:
11
Borislav,

We tried a similar logic by creating a test app with a timer class that instantiate a Custom class from timer Init event, then adding code
to timer Event to set a timeout flag in Custom Class


ocustom is TImer Object property that is instantiated in TIMER INT event as such:
this.ocustom=CREATEOBJECT("custCls")


the TIMER Event in Timer class, contains the following code:

?"timefire"
?this.ocustom.name
this.ocustom.ltimeout=.t.
KEYBOARD "{ESCAPE}" && here I add this to Interrrupt the report spooling


the CustCls contains a "mlongprocess" method that has the following code:
IF this.ltimeout
RETURN .f.
ELSE
SET ESCAPE ON
ON ESCAPE do cleartimer()

lcpdFfile="c:\longreport.PDF"
lcRptName="Rptind_cust"
*-- some other code in here for instantiate PDF printer
loPDFPrinter.DefaultFileName=lcPdfName
REPORT FORM &tcRptName TO PRINTER NOCONSOLE NOWAIT

ENDIF

WAIT " end of Long process" WINDOW nowait


_________________________________________________

From VFP command windows, did the following:

otimer=CREATEOBJECT("clstimer")
otimer.interval=20*1000 && 20 seconds

the timer fire and display messages to VFP windows, but as we execute the following command:

otimer.ocustom.mlongprocess()


a window show up with print spooling pages
the timer event stop executing, the only way to stop it by manually hitting ESCAPE.

It look like that REPORT FORM TO PRINTER transfer the control to Printer.
Jihan Haidar
Software Engineer
jhhaidar@sbcglobal.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform