DBFLibDBF and FPT files for Ring

Field types and constants

The field types, the field definition format and the constants.

Field Types#

Type CodeDescriptionNotes
CCharacter (string)Fixed width, space-padded on the right
NNumericStored as a formatted ASCII string
FFloatLike N but allows scientific notation
DDate8-char string in YYYYMMDD format
LLogicalStored as T / F
MMemoVariable-length text in .fpt file; transparent to caller
GGeneral (OLE)Same layout as M; text content supported
IInteger4-byte little-endian binary
BBinaryZero-initialised on append

Field Definition Format#

When calling create(), each field is defined as a list with 3 or 4 elements:

Ring
[FieldName, TypeCode, Length, Decimals]   # 4-element (full)
[FieldName, TypeCode, Length]             # 3-element (decimals default to 0)

Constants Reference#

Version Flags#

The two flags the library writes when creating files:

Ring
C_DBF_VERSION_FOXPRO        # 0x30  Visual FoxPro — no memo fields
C_DBF_VERSION_FOXPRO_MEMO   # 0xF5  Visual FoxPro — has memo fields

Additional flags recognised when reading existing files:

Ring
C_DBF_VERSION_DBASE3        # 0x03
C_DBF_VERSION_DBASE3_MEMO   # 0x83
C_DBF_VERSION_DBASE4_MEMO   # 0x8B

Record Markers#

Ring
C_DBF_RECORD_ACTIVE     # 0x20  space — record is active
C_DBF_RECORD_DELETED    # 0x2A  asterisk (*) — record is soft-deleted
C_DBF_EOF_MARKER        # 0x1A  end-of-file marker
C_DBF_HEADER_TERMINATOR # 0x0D  end of field descriptor list

Field Sub-list Indices#

When working with the list returned by getStructure(), use these named indices instead of bare numbers:

Ring
FLD_NAME    # 1 — field name string
FLD_TYPE    # 2 — single-character type code
FLD_LEN     # 3 — storage length in bytes
FLD_DEC     # 4 — decimal places
FLD_OFFSET  # 5 — byte offset within the record (internal use)
DBFLib - DBF and FPT files for Ring, made with ringdoc.