Using fp to exit a batch process

Richard Kreiss rkreiss at gccconsulting.net
Fri Jun 7 06:47:25 PDT 2013



> -----Original Message-----
> From: filepro-list-bounces+rkreiss=verizon.net at lists.celestial.com
> [mailto:filepro-list-bounces+rkreiss=verizon.net at lists.celestial.com] On
> Behalf Of Richard Hane
> Sent: Friday, June 07, 2013 9:09 AM
> To: fplist
> Cc: Rick Hane
> Subject: Using fp to exit a batch process
> 
> Windows 7, fpODBC 1.0.15 network 16 user
> 
> Situation:  Running a long batch file containing fp processes.  If in processing a
> condition is found, I would like to exit not only the current process (easy with
> 'Exit'); but also totally exit the batch file.  In short do not let the balance of the
> batch file run.
> 
> I think I could issue a system command to move to another directory (away
> from the batch file).
> 
> Does anyone have a better suggestion?

When the exit condition occurs use EXIT(NN).

In you batch file that started the process after the start of the filePro program

IF ERRORLEVEL 99 GOTO DONE
IF ERRORLEVEL 90 GOTO OK
:ok
Additional processing 
:done


In my case I can have 2 exit conditions, 99 is a login failure and 90 is a proper login which the runs a filepro menu allowing the user to use the application.

I also use this where I have a batch file which creates a csv file and then opens it in Excel.  I the user cancels out or no records are selected, the Excel routine is not run.


Richard Kreiss
GCC Consulting

Office: 410-653-2813






More information about the Filepro-list mailing list