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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Return Code to Batch File

Status
Not open for further replies.

kd1563

Programmer
Nov 20, 2000
3
0
0
US
I am running a Foxpro 2.6 executable from a batch file. I need to have Foxpro return a return code that the batch file can act on. Any suggestions?
 
1. Write a text file with the information and have the batch file loop untill the file is there and then delete it after is uses it.
2. Create a DOS Enviroment variable in the batch file and have the batch file loop until it is a different value. In the exe change the variable just before exiting the program.

David W. Grewe
Dave@internationalbid.com
ICQ VFP ActiveList #46145644
 
If you want the FoxPor routine to do some stuff first and then have the batch file act on it, you could have FoxPro create a small .BAT file that your original batch file could call (STEP2.BAT).

TEST.BAT contains:
START /w c:\foxprow\foxprow.exe routine.prg
CALL STEP2.BAT
REM Rest of batch file here

/w - says wait until program termination to continue batch file execution.

ROUTINE.PRG contains:
*
*... code to do some processing here ...
STORE 0 TO proc_items
SCAN
proc_items = proc_items + 1
ENDSCAN
*
SET DEVICE TO C:\STEP2.BAT
@ 0,0 say "THE_EXE " + alltrim(str(proc_items))
SET DEVICE TO SCREEN
QUIT

Substitue "THE_EXE" for whatever executable the batch file runs. proc_items is the count of items that processed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top