Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Running Multiple Windows EXEs Within FoxPro
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00171620
Message ID:
00171683
Views:
22
>I needed to generate a dbf file within a VFP application - when the file was done I had to first run it thru (within VFP) a third party WINDOWS app for further processing and when that was ready I had to run it thru a second Windows app. The code I wrote was as follows:
>
>generate DBF ...
>RUN /N app1.exe ...
>RUN /N app2.exe ...
>
>The problem was app2 loaded right behind app1's tail and it started processing before app1 finished or even started it's job. I tried the /N3 switch and NO switch and also placing both *RUN* lines in a single DOS .bat file. Any help would be appreciated.

**********************************
Try the SYS_Processes() function in FOCUS.FLL. FOCUS.FLL is a marvelous set of functions available for free at "http://www.fastwrite.com/focus/focus.htm". SYS_Processes() returns a list of running processes. You can use it in the following function to loop until App1.exe is closed.

FUNCTION IsRunning(tcExeName)
* Returns True if tcExeName is running
LOCAL llProcessFound, lcProcess
SET LIBRARY TO FOCUS.FLL ADDITIVE
llProcessFound = .F.
tcExeName = UPPER(tcExeName)
lcProcess = UPPER(SYS_Processes())
IF tcExeName $ lcProcess
llProcessFound = .T.
ENDIF
RETURN(llProcessFound)

*************************************
generate DBF ...
RUN /N app1.exe ...
DO WHILE IsRunning("app1.exe")
ENDDO
RUN /N app2.exe ...
Dennis Lindeman
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform