home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Shareware - Software Farm 2
/
wosw_2.zip
/
wosw_2
/
DATABASE
/
PARADUMP.ZIP
/
PARADUMP.DOC
next >
Wrap
Text File
|
1992-07-18
|
17KB
|
463 lines
PROGRAM: PARADUMP.EXE version 1.05
Copyright (c) 1992 by Thomas A. Lundin.
All Rights Reserved.
DESCRIPTION: Paradox Data Export Program
RELEASE DATE: 7/18/92
AUTHOR: Thomas A. Lundin
16267 Husdon Avenue
Lakeville, MN 55044
PHONE: (612) 588-7571 (8am-5pm Central, weekdays)
(612) 431-5805 (nights and weekends)
REGISTRATION: $25 per copy (site licenses available)
ABSTRACT:
PARADUMP is a stand-alone program which exports Paradox 3.0/3.5
database tables into any of five different formats: fixed-length
fielded ASCII, comma/quote-delimited ASCII, comma-delimited ASCII,
tab-delimited ASCII, and WordPerfect 5.1 secondary merge format.
REVISION HISTORY:
1.05 7/18/92 Fixed bug for alpha fields >127 characters
1.04 6/30/92 Fixed bug for >32K records
1.03 6/9/92 Added output count, redirected structure output
1.02 5/25/92 First shareware release
PARADUMP.EXE is distributed as shareware. It is not free software. If you
continue to use this program beyond a 30-day trial period, you are required
to register it. The registration fee for this version is $25 per copy. Upon
registration, you will receive the most recent version of the program
without the compliance message. Make checks payable to Thomas A. Lundin
(U.S. funds and drawable at a U.S. bank). Please send your registrations
to:
Thomas A. Lundin
16267 Hudson Avenue
Lakeville, MN 55044
The registration fee for PARADUMP on network file servers is a $50 flat
charge for up to 20 workstations PER SERVER, and a $100 flat charge for
unlimited (over 20) workstations PER SERVER.
I welcome suggestions and comments regarding PARADUMP.EXE. The suggestions
of registered users will always be considered first. Please respect the
tenets of shareware and register if you intend to use the program beyond
the trial period. It is my policy to not add features to the program on the
promise of registration, so if you are not a registered user, please do not
ask me to change the program to suit your needs. Program bugs are a
different story. I will investigate reported bugs from any user and will
attempt to fix those within my control.
DISCLAIMER.
This program and its associated documentation are provided AS IS, without
any express or implied warranty. The program is not warranted as to
suitability or fitness for any particular purpose. The author and/or
distributor of this program shall not be held liable for any perceived or
real damages emanating from the use or misuse of this program. The user of
this program understands that operation of this program is undertaken at
the user's own risk.
INTRODUCTION.
The impetus for writing PARADUMP came out of my frustration at trying
to export a fixed-length ASCII file from a Paradox 3.5 data table. The
only method prescribed by Borland was to create a Paradox report
specification and output the report to disk. So I tried that, and two
problems became immediately apparent: 1) outputting from a report was
tediously S-L-O-W, and 2) the last field of a fixed-length record
wasn't padded to its full field width. This meant that I had to put a
dummy field at the end of each record to ensure that the last Paradox
field would be padded out. All of this rigmarole for each table
(creating a report specification, placing a dummy field, outputting to
disk) was too much for me to bear, especially when compounded by the
exorbitantly slow output times. It was actually much faster to use the
ASCII Delimited Export command sequence in the Tools menu, and to run
the exported file through a file filter that padded the variable-
length ASCII fields back to a fixed-length form, but this wasn't
exactly an elegant long-term solution. The other option I was offered
was to purchase the Paradox Database Engine for $99, which seemed like
overkill for what should have been an atomic Paradox operation in the
first place, and besides, I've seen programs written with the Engine,
and they seem incredibly bloated for what they do. Nobody at Borland
wanted to provide me with any hints on the Paradox table structure (as
if that information was somehow Restricted For Reasons Of National
Security), so I spent a couple of weeks reverse-engineering it and
writing this program in my spare time.
PARADUMP does exactly what I wanted it to do: reads a Paradox table
and creates a fixed-length ASCII file from it, in one step. The
performance of PARADUMP is roughly the same as the ASCII export
command in Paradox, which I find quite acceptable, and in any case
infinitely better than Report. A record layout for the converted ASCII
file is generated in a file named PARADUMP.STR. (A record layout is
critical if you expect someone else to import the fixed-length data
into another program.)
Once the code base was complete, it was a simple matter to extend the
conversion process to allow export into several other transfer
formats. This facility should allow Paradox files to be exported for
use with most other word processing and database programs.
PARADUMP.DOC REV. 7/18/92 PAGE 2
USING THE PROGRAM.
The program is command-line driven. The form of the command line is:
paradump PDOXTBL.DB OUTPUTFILE.EXT [Pn[,n,n...]] [On] [Dn]
where:
PDOXTBL.DB is the name of the Paradox file to be exported.
OUTPUTFILE.EXT is the name to give the exported file.
Pn... is an optional format for specifying the number of decimal
places to show in NUMERIC fields. The 'n' represents a numeric value.
More on this later.
On is an optional switch for specifying the type of output file to
create. The 'n' represents a numeric value. More on this later.
Dn is an optional switch for specifying the number of digits a year
will occupy. The 'n' represents a numeric value. More on this later.
The default action (where none of the optional switches is selected)
is as follows:
The exported file is a fixed-length ASCII text file. Fields are
padded where necessary to full width and records are terminated with a
carriage return/line feed.
Alpha fields are padded with spaces to full width, left aligned.
Numeric fields are output in a 17-character text field, right
aligned. 15 significant digits are expressed. Decimal alignment does
not occur; as many decimal places as are needed will be output in the
field, and this may vary from record to record.
Dates are output as alphanumeric fields in the form MM/DD/YYYY,
(10 characters).
Short fields are output to 6 digits, right aligned.
Dollar fields are output in a 17-character text field, right
aligned, including two decimal places. 15 significant digits are
expressed.
PARADUMP does not recognize primary or secondary indexes. The data
records are exported in physical (unindexed) order.
When a Paradox table is exported using PARADUMP, an ASCII file with
the same name as your output file but with an extension of .STR is
created (so don't use an extension of .STR in your output filename).
This file contains a listing of the exported table structure. The
listing includes the field name, the type of field being exported, and
the width of the field (if a variable-length output option is
selected, the field width indicates the maximum number of characters
allowed in the field). Numeric and dollar fields are always 17
characters wide, but numeric fields can have a variable number of
digits after the decimal point. The number of decimal places is shown
in parentheses following the field width. A decimal place value of -1
PARADUMP.DOC REV. 7/18/92 PAGE 3
means that the decimal point floats (that is, it appears in whatever
position is natural for the numeric value stored in the field). You
can specify a fixed number of decimal places with the P option,
explained below.
ALTERNATE OUTPUT OPTIONS.
1. CHANGING THE OUTPUT FILE TYPE (the O option).
PARADUMP has the ability to output to several other file types by
setting the O option (letter Oh, not numeral Zero). The following
options are available:
O1 - comma/quote-delimited ASCII. Fields are output as variable-
length text. Each field is surrounded by quote marks, fields are
separated from one another by a comma. Records are terminated by a
carriage return/line feed.
O2 - tab-delimited ASCII. Fields are output as variable-length
text. Fields are separated from one another by a tab character
(ASCII 9). Records are terminated by a carriage return/line feed.
O3 - WordPerfect 5.1 secondary merge. Fields are output as
variable-length text. Fields are separated from one another by a
control-R (ASCII 18) and a carriage return/line feed. Records are
terminated by a control-E (ASCII 5) and a carriage return/line
feed.
O4 - comma-delimited ASCII. This is the same as option O1, except
numeric and dollar fields are not surrounded by quote marks, so
they can be distinguished from text fields. This format is used
largely for importing into Lotus 1-2-3 or other spreadsheet
programs.
2. CHANGING THE DATE FORMAT (the D option).
Dates in PARADUMP are output as text strings in MM/DD/YYYY format
by default. You can output dates as MM/DD/YY by setting the D
option to D2. Since a 2-digit year can't differentiate between
centuries, you'd want to be sure that all of your dates fall within
the same century if you choose D2.
3. SPECIFYING DECIMAL PLACES (the P option).
Numeric fields by default are output with a floating decimal point
within a 17-character text field, right aligned (15 significant
digits are expressed); this means that whole numbers will be output
with no decimal point at all, and fractional numbers will be output
to as many decimal places as required. There are instances,
however, when it is desirable to align the decimal points in a
field; this requires a fixed number of decimal places to be output.
The P option allows you to set the number of decimal places for
each numeric field, in a range from 0 to 7, or specify a floating
decimal point.
PARADUMP.DOC REV. 7/18/92 PAGE 4
The format of the P option is:
Pn,n,n,n,n,n...
where each 'n' is a number representing the number of decimal
places to carry in the field. If you use the P option, you must
specify a value (even if it is a BLANK value) for each and every
field in the table. If your table contains 10 fields (even if some
of them are Alpha fields), you must have 10 values in the P option.
Of course, it is meaningless to assign a decimal place value for an
Alpha field, but a comma must be used as a field placeholder
anyway.
For instance, assume that your table contains five fields of the
following types: Alpha, Numeric, Numeric, Alpha, Dollar. Let's say
you wanted the first numeric field to be output to 3 decimal
places, and the second numeric field to be output to 0 decimal
places. The P option would look like this:
P,3,0,,
The first value is a blank placeholder for the Alpha field, the
second value is a 3, the third value is a 0, the fourth value is a
blank placeholder, and the fifth value is a blank placeholder. You
could also enter any number instead of a blank placeholder; a
decimal place value will be ignored for non-numeric fields. For
instance, this P option line:
P8,3,0,1,1
would have the same effect as the previous one, since only the
second and third fields in the Paradox table are Numeric fields.
(Remember that Dollar fields are always output to two decimal
places.)
A value of -1 is used to indicate a floating decimal point (which
is the default). Thus, you can mix fixed-place decimals with
floating-place decimals in the same record.
IMPORTANT NOTE!
The P option has a special characteristic that affects all numeric
fields: THE LAST SPECIFIED VALUE IN THE P OPTION WILL AFFECT ALL
SUBSEQUENT NUMERIC FIELDS. For instance, if you had a P option that
looked like this:
P4
...every numeric field in the table would be output to four decimal
places. As another example, assume you have a Paradox table that
has fields of the following types: Alpha, Alpha, Numeric, Date,
Numeric, Numeric, Numeric, Numeric, Numeric. If you had a P option
that looked like this:
PARADUMP.DOC REV. 7/18/92 PAGE 5
P,,2,,3
...the first Numeric field would be output to two decimal places,
and the second and all subsequent Numeric fields would be output to
three decimal places. If we change the P option to this:
P,,2,,3,-1
...the first and second Numeric fields will be output to two and
three decimal places, respectively, and the third and subsequent
numeric fields will be output with a floating decimal point.
Try experimenting with the P option. Play around with different P
values to get a good idea of how the P option affects your output.
PARADUMP.DOC REV. 7/18/92 PAGE 6
REGISTRATION FORM
DATE: ________________________
NAME: __________________________________________________________________
COMPANY: _______________________________________________________________
ADDRESS: _______________________________________________________________
_______________________________________________________________
CITY: _______________________________ STATE: _______ ZIP: _____________
PHONE: _____________________________ FAX: ______________________________
FEE SCHEDULE QTY AMOUNT
REGISTRATION FOR PARADUMP 1.05 @ $25 PER COPY ________ x $25 = _________
SITE LICENSE FOR STAND-ALONE UNITS
5 - 10 UNITS @ $15 PER COPY ________ x $15 = _________
11 - 20 UNITS @ $10 PER COPY ________ x $10 = _________
OVER 20 UNITS @ $5 PER COPY ________ x $ 5 = _________
NETWORK FILE SERVER REGISTRATION
<=20 WORKSTATIONS @ $50/FILE SERVER ________ x $50 = _________
>20 WORKSTATIONS @ $100/FILE SERVER ________ x $100= _________
SHIPPING AND HANDLING (INDICATE ANY THAT APPLY)
(For single copies only; call for S/H on multiple copies)
FIRST CLASS MAIL ___$5.00_
UPS GROUND ____7.50_
OVERNIGHT DELIVERY ___20.00_
C.O.D. ADD ____7.50_
TOTAL ________ _________
Send this form with payment to:
Thomas A. Lundin
16267 Hudson Avenue
Lakeville, MN 55044
Payment terms are Prepaid or C.O.D.
Corporate purchase orders accepted from Fortune 1000 firms only.
PARADUMP.DOC REV. 7/18/92 PAGE 7