rzdz@fluke.UUCP (Rick Chinn) (08/07/84)
re: dbase database files and other programs.
Yes, you can create a dbase file from another program's datatfile. The
easiest way is to have the datafile in comma delimited form (each field
delimited with commas, fields with embedded commas must be quoted). Then use
the append delimited (I'm not sure of the syntax because the docs aren't
here at work) command. Check your user manual. I've used the command to add
a Mailmerge datafile to a dbase datafile. It worked fine. You can also go
the other way very easily (dbase --> comma delimited). I do that a lot do
create form letters that I merge print.
A last possibility is to create a program that reads the database and
creates a dbase formatted file. Back in march, dNews published the
"Structure of the Structure". Here it is:
Structure of DATA files.
Byte Contents Meaning
0 02H dbase II database file
1-2 16 bit no. Number of records in this database
3-5 3 bytes Date of last update (MM DD YY) binary
6-7 16 bit no. Size of the record
8-519 32x16 byte field descriptors
array:
byte 0-9 field name in ASCII, zero filled
byte 10 hex zero
byte 11 field type; "C", "N", or "L", in ASCII
byte 12 field size in binary
byte 13-14 absolute adress where field is located in memory (16
bit number)
byte 15 number of decimals in binary
Field descriptors are terminated by a carriage return (0DH)
520 1 byte Field terminator (0Dh) if all 32 fields are present,
otherwise null (0H).
Notes:
1. Data records are preceded by one byte that is a space (20H) if the
record is not deleted, and an asterisk (2AH) if it is deleted.
2. Data fields are packed into records with no separators or record
terminators.
Structure of Floating-Point Numbers:
Byte Contents Meaning
0 1 bit sign bit - 1 = negative
7 bits exponent biased by 40H
1-n packed decimal mantissa
Notes:
1. n = 5 for standard dbase.
2.
0 = 00 00 00 00 00 00
1 = 40 10 00 00 00 00
-1 = C0 10 00 00 00 00
.1 = 3F 10 00 00 00 00
123 = 42 12 30 00 00 00
Structure of Character Strings:
Byte Contents Meaning
0 8 bit no. number of characters in string
1-n bytes data bytes
e.g.
"ABC" = 03 41 42 43
| A B C
\--- 3 characters
That's it, straight from the horses mouth.
Rick Chinn
John Fluke Mfg. Co MS 232E
PO Box C9090 Everett WA 98206
ihnp4!uw-beaver----\
decvax!microsof \
ucbvax!lbl-csam \
+====!fluke!rzdz
sun /
sb1!allegra /
ssc-vax------------/
(206) 356-5232