Dec 122017
 
A DOS utility that reads a FoxPro database with memo fields and reports everything you want to know about the corresponding memo field file. The information includes blocksize, next available block, number of dbf records,
File CHKFPTPO.ZIP from The Programmer’s Corner in
Category Databases and related files
A DOS utility that reads a FoxPro database with memo fields and reports everything you want to know about the corresponding memo field file. The information includes blocksize, next available block, number of dbf records,
File Name File Size Zip Size Zip Type
CHKFPTPO.DOC 10055 4245 deflated
CHKFPTPO.EXE 8362 8006 deflated

Download File CHKFPTPO.ZIP Here

Contents of the CHKFPTPO.DOC file


ChkFptPO, (c) 1990 P.L. Olympia & Kathy Cea, Platinum Software Int'l

10/13/90

1.0 SOME BACKGROUND PLEASE, MAESTRO

We at PSI are about ready to release our first two products: FRX2PRG and
MEMOPAK. FRX2PRG reads a FoxPro report form (.frx) file and creates a
program (.prg) that you can study, modify, compile, or include in any of
the other Dbase dialects, including FoxPro. MEMOPAK is an enhanced
version of Darwin System's MEMOPO program. It will allow very fast
import, export of any size data from all sources (including text data
downloaded from a mainframe) to/from memo fields of FoxPro, FoxBASE+,
Clipper, dBASE IV, dBASE III+, dBXL/Quicksilver. Obviously, you can use
it to export/import memo field data to/from your favorite word processor
or text editor. It also will pack (very fast) memo fields of all Dbase
dialects. It will also include a memo file interconversion among all
Dbase dialects--all from the DOS command line. We will probably also
add a memo field diagnostic/repair option to the program. In short,
MEMOPAK is meant to be your do-it-all tool for Dbase memo field
manipulation. We thought of naming it ADVANCED TURBO PROFESSIONAL ++.

Anyhow, while writing MEMOPAK and after giving a talk at the 2nd Annual
FoxPro Developer's Conference in Toledo, Ohio (a *VERY* quiet town--the
War of the Worlds was fought there and Toledo lost), a few developers
wanted some help with corrupt FoxPro memo files. We thought it would be
nice to have a little program that can spit out important information
about FoxPro memo files including whether a record is trashed, or if
not, how much data space, if any, a memo field record is occupying.

Thus, ChkFptPO was born.

A side note: Portions of this program were created at the Detroit Airport
on the way back to Washington, DC after the Fox conference while my
Compaq Portable II was plugged into a janitor's electrical outlet. I
thank Chaim Carron, a FoxPro developer, for helping me find a trashcan
to use as a computer stand. I also want to thank the Airport authority
for the electricity.


2.0 WHAT IS CHKFPTPO?


ChkFptPO is a DOS utility that reads a FoxPro database with memo fields
and reports everything you want to know about the corresponding memo
field (.fpt) file, including:

-- .fpt blocksize
-- Next available block
-- Whether or not the Next Available Block value is bad
-- How many records in the database file
-- How many memo fields in the database
-- and ...
For every memo field and for each database record desired:
o whether the memo field data is ext or

icture or
*Corrupt*
o whether the memo field is empty or, if not, how many bytes
it is occupying.

It does not require FoxPro to operate. It does NOT screw up your files
since it only reads them.

By design, although this program has the ability to make minor repairs
to a corrupted memo file, it does not do that. We will include that
capability in MEMOPAK because we need that feature to be extensively
tested. Speaking of testing, I would like to hear from all users or
programmers who have corrupted memo files. I would like to see samples
(since we seem to be so blessed we can't manage to mangle memo files) to
try the program on. I also would like to know under what circumstances
these memo files tend to be clobbered. Please leave me a note either at
the Darwin BBS (301-251-9206) or at Compuserve 73765,121 (Pete Olympia).



3.0 SYNTAX AND OUTPUT

Run the program from the DOS command line with the following syntax:

ChkFptPO []

where is the name of the FoxPro database (.dbf) file. You
don't need to specify the .dbf extension. may contain a
path/directory prefix. It may NOT contain wildcard characters. Make
sure thet the corresponding .fpt file resides on the same
path/directory.

is an optional command line parameter. You use it to
specify the range of records you want to see. For example, specifying

10-118

tells the program you want to see information about memo fields of
database records 10 through 118 inclusive. The upper and lower bounds
must be separated by a dash. If you don't know how many records there
are in the database, just specify a very large number. The program is
smart enough to know that you want your upper bound to be the number of
records in the database.

If you omit the option the program will process *ALL*
records. This is probably what you want most of the time. Note that if
you process a large file such as FOXHELP, omitting the option will take
more than a second.

You can redirect the output to a file or printer using the DOS
redirection ">" command.

If you invoke the program without any argument, it will remind you of
its command syntax after advertising itself (what a country, eh? -- you
can never get away from commercials). It will also advertise itself if
you screw up with the command line argument(s). So, do it right and you
won't have to see the advertisement, ok?

Following is a sample program invocation and output. In this example,
you want the program to process the file CORRUPT.DBF in the J: drive,
showing memo field header data and only memo field status of records 3
through 6. The output is redirected to the file MYFILE.OUT in the A:
drive.

C>ChkFptPO j:corrupt 3-6 >a:myfile.out

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Dbf File: J:CORRUPT.DBF
Memo field blocksize : 64
Next Avail Block : 45
Number of DB Records : 7
Number of Memo Fields: 2
*Warning* Probably incorrect Next Avail Block. Should be 39

Record Num Memo Field T/P Len Memo
---------- ---------- --- --------
3 PROC_FULL T 76
NOTES T 945
4 PROC_FULL T 45
NOTES
5 PROC_FULL T 147
NOTES T 1125
6 PROC_FULL T 803
NOTES *Corrupt*
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Note: In the T/P column, T means Text, and P means Picture.
Corrupt means just that--bad memo field record.

Note that this file also has a corrupted header data value. The
Next Available Block points way past EOF. The program has figured
out that the correct value is 39. In this case, if you try to
use this file in FoxPro, FoxPro will refuse to open the file and
give you the error message "Invalid or missing memo file."

What to do? What to do?

You have three choices:

1. The easy (but tedious!) workaround is to pad the .fpt file
with any data so that the current (incorrect) Next Available
Block value becomes legitimate. Find the smallest file that can
legitimize this value, e.g., your CONFIG.SYS or a small .DBF,
then do a binary copy:

COPY /B CORRUPT.FPT+SCRAT.DBF CORRUPT.DBF

Go into FoxPro, USE the database, then do a COPY

USE CORRUPT
COPY TO TEMP && TEMP is now the fixed dbf/fpt file

2. Use DEBUG or Norton Utility to change the value of the Next
Available Block. See our "Developing FoxPro Applications" book
for the format of a FoxPro .fpt file and all other FoxPro files
for that matter.

3. Wait for MEMOPAK



4.0 DISTRIBUTION POLICY

The ChkFptPO package includes:

o ChkFptPO.Exe
o ChkFptPO.Doc (this file).

They are copyrighted by Platinum Software International but may be
freely distributed for non-commercial use only and must be distributed
as a package containing both files unmodified. Use at your own risk.
It works for me.

Report any problems or requests for enhancements to the authors. Read on
if you want to know how to contact them.


5.0 NOW, A WORD FROM YOUR SPONSOR

Platinum Software International of North Potomac, Maryland conducts
in-house training and seminars and develops custom Dbase and network
applications and utilities. We know a lot (blush).

Looking for an advanced book on Dbase for you, your programmers or for
use as a textbook? Check out "Developing FoxPro Applications (with
Multiuser Techniques)" by P. L. Olympia and Kathy Cea, Addison-Wesley.
The book has chapters on Database Design, Data Dictionary, Designing and
Customizing an Application, Array Techniques, Memo Field Techniques,
etc. It also has the file structure of most FoxPro files, including
.frx, .lbx, .dbf, .fpt and .idx. The programs FRXALIAS, DMPIDXPO and
CHKFPTPO which we have released to the public all use file information
that is described in the book.

There is a disk that can be ordered separately, containing not
only all the programs and sources described in the book but additional
programs and utilities for Dbase and networks not published in the book.
Order the disk by sending the form on the last page of the book. The
disk also includes sample .c programs for displaying data about .frx and
.lbx files. If you want to see a list and description of all programs
on the disk, get the file BOOKDISK.TXT from the Darwin BBS or read
Bulletin 2 of the BBS.

For more information, leave a message to SYSOP at the Darwin BBS,
301-251-9206, 1200 to 19200 bps or write to:

Platinum Software International
17 Thorburn Road
North Potomac, MD 20878

or call voice: 301-251-0497.
or leave CIS message to: 73765,121.

Enjoy. And may your handle never be transgressed!



 December 12, 2017  Add comments

Leave a Reply