Foxpro Keeps running after starting R&R 8

Meeting place for R&R customers and clients to share tips and ideas. Post your questions, messages or problems here.
Post Reply
Mike_(Guest)
Posts: 1
Joined: Tue Oct 10, 2017 12:44 pm

Foxpro Keeps running after starting R&R 8

Post by Mike_(Guest) » Mon Jun 11, 2001 10:59 pm

I have some apps that go back to DOS days. Using the Foxpro run command it was OK to run an R&R Report 4, 5 or version 6 because it would wait for the report to complete.____Since Foxpro 2.6 for windows and all version of VFP, I have used R&R 6.5 or 7 or 8. But none of these versions of Foxpro wait for the report to end. It just spawns another task that is totally independent of VFP.____On network apps, I create a temporary work file for R&R then delete the temp file when R&R is done. Guess what? It removes the temporary file and R&R is still trying to report it. CRASH! Here is the best I have:____ Do createtemp ____ Run RRWRUN REPTLIB 1__ wait "please wait until the report has finished " window____ Do erasetemp____But many users accidentally click the mouse or press a key or look at their email and the wait window releases. ____Help____Thanks in advance.

kfleming
Posts: 5795
Joined: Tue Oct 10, 2017 12:44 pm

=> RE: Foxpro Keeps running after starting R&R 8

Post by kfleming » Tue Jun 12, 2001 9:01 am

You could alternatively use the OCX interface to call R&R.__If you set the Action property to 1, your application code will not proceed until the report has completed.____Kathleen__R&R Support

Bob_Powell_(Guest)
Posts: 17
Joined: Tue Oct 10, 2017 12:44 pm

=> RE: Foxpro Keeps running after starting R&R 8

Post by Bob_Powell_(Guest) » Tue Jun 12, 2001 2:10 pm

Supposedly if the bWait parameter to the function execRuntime is non-zero, the function will synchronously.. but I have not been successful in getting it to work that way in VFP. I would like to know if you have a VFP example that it does work properly in?____-Bob

Bob_Powell_(Guest)
Posts: 17
Joined: Tue Oct 10, 2017 12:44 pm

==> RE: Foxpro Keeps running after starting R&R 8

Post by Bob_Powell_(Guest) » Wed Jun 13, 2001 1:27 pm

Here is some code that I use to prevent VFP from going on...____if file(m.cTempDir + ^ rwstats.txt^)__ erase (m.cTempDir + ^ rwstats.txt^)__endif____=setStatusFileName(hRpt, m.cTempDir + ^ rwstats.txt^)____=execRuntime(hRpt, 0, 0, @nErrorCode, @nPagesPrinted, @cErrorMsg, 254) ____* need to loop through until status file is create__* and then loop through until the error code returns some value_____do while !file(m.cTempDir + ^ rwstats.txt^)__ wait window "Please wait while report prints..." timeout 1__enddo____*******__Hope this helps.__-Bob__

Mark_LaBarre_(Guest)
Posts: 4
Joined: Tue Oct 10, 2017 12:44 pm

==> RE: Foxpro Keeps running after starting R&R 8

Post by Mark_LaBarre_(Guest) » Mon Jun 18, 2001 6:53 pm

Another way to do this is to do an FOPEN(<filename>,12) and try to open it directly for Read/Write, it will give you an error code (-1) until such time as R&R is through and has closed the file. Then you will get a valid file handle (positive #) since Fox can now get Write access. At that point you can do an FCLOSE and go on with your business.____This will take into account a case in which the filename may be created and shows up in the directory with a zero byte size, but the file is still open and the process that^s creating it is not yet complete. I have known this to happen, though not necessarily with R&R.

Post Reply