The Database Managers, Inc.

Contact The Database Managers, Inc.


Use an RSS enabled news reader to read these articles.Use an RSS enabled news reader to read these articles.

Page 3

Compiling DataFlex Programs

by Curtis Krauskopf

Don't Stop on Errors

One problem hasn't been fixed yet. When dfcomp is compiling programs, it still stops at every error and waits for the programmer to acknowledge the error message.

Data Access has provided command-line parameters for dfcomp that allow it to compile programs and silently process errors. Using

dfcomp filename.src -v1fskw

will compile FILENAME.SRC and generate FILENAME.FLX (if the source is successfully compiled) or FILENAME.ERR if there were compile-time errors. The file FILENAME.PRN is always generated and it contains information about how the program was compiled.

One problem with this technique is that the existence of a .ERR file does not necessarily mean that the file had a compile-time error. dfcomp does not delete a .ERR file if the source file compiled successfully. One way to determine if the .ERR file is for the most recent compilation is to compare its time/date stamp with the time/date stamp of the .PRN file. If they match, then the errors in the .ERR file are for the most recent compilation.

A simpler way is to just delete all of the .ERR files before compiling.

The following batch file allows a coder to compile a group of source files. The existence of any .ERR files when the compilation is complete indicates source files that compiled with errors. .ERR files are always deleted when the batch file starts.

dfc.Bat:

@echo off

REM dfc.bat:
REM   Created by Curtis Krauskopf
REM   October 9, 2003
REM   The Database Managers, Inc.
REM   http://www.decompile.com
REM   Permission to use this batch file is granted
REM   provided this banner stays in the file.

if x%1==x goto instructions

REM   Eliminate all .ERR files.  Create one .ERR file
REM   so that the del command doesn't complain that
REM   no files were deleted.
echo x > 1.err
del /q *.err

REM   Compile the %1 parameter
for %%s in (%1) do dfcomp %%s -v1fskw
echo.
Echo Compilation Finished 
echo File Not Found means there were no compile-time errors:
dir /-b *.Err
goto done :instructions echo   You need to provide a filename (with optional echo   wildcards) that is used to compile the programs. Echo     Example: %0 ap*.src menu.src gl*.src :done

 

Go Back to Page: 1   2
Copyright 2003-2010 The Database Managers, Inc.

 

DataFlex Decompiler
DataFlex: Tips | Freeware | WebApp Server | Books | Links
Services | Programming | Contact Us | Recent Updates

Send feedback to: