Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Running Multiple Windows EXEs Within FoxPro
Message
From
30/12/1998 14:27:03
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00171620
Message ID:
00171646
Views:
27
>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.

How about this:

App1.bat:

@ECHO OFF
APP1.EXE
DEL FILE1.DAT


App2.bat:

@ECHO OFF
APP2.EXE
DEL FILE2.DAT


Now, in Foxpro:
  m.fnum = FCREATE("FILE1.DAT")
  =FCLOSE(m.fNum)
  RUN APP1.BAT
  DO WHILE FILE("FILE1.DAT")
    DOEVENTS
  ENDDO

  m.fNum = FCREATE("FILE2.DAT")
  =FCLOSE(m.fNum)
  RUN APP2.BAT
  DO WHILE FILE("FILE2.DAT")
    DOEVENTS
  ENDDO
The idea is to create a file that will be deleted when we are ready to go to the next step. I think it's called a semaphore file. I have done little error handling (like what if our FCREATE failed?).
Sylvain Demers
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform