home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mega CD-ROM 1
/
megacd_rom_1.zip
/
megacd_rom_1
/
MAGAZINE
/
INSIDE_T
/
ITPJUL90.ZIP
/
PRINTDBF.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1990-06-28
|
2KB
|
74 lines
{================================================
= PROGRAM: PRINTDBF.PAS =
= PURPOSE: Print listings of Dbase III+/IV =
= DBF files =
================================================}
{------------------------------------------------
Initialize variables and create types -
-----------------------------------------------}
USES Crt, dBASE;
VAR
DFile : DbfFile;
ActionHdr : Byte;
ActionFile : Boolean;
PROCEDURE Beep;
BEGIN
Sound(1000);Delay(500);NoSound
END;
{------------------------------------------------
- Main processing loop -
-----------------------------------------------}
BEGIN
ClrScr;
DFile := DbfOpen('PLANETS.DBF');
WriteLn;
ActionHdr := DbfReadHdr(DFile);
CASE ActionHdr OF
1 : BEGIN
Beep;
WriteLn('Not a dBASE III+ or IV file.')
END;
3 : BEGIN
Beep;
WriteLn('Error reading dBASE file.')
END
ELSE
BEGIN
DbfDispHdr(DFile);
Pause;
ActionFile := DbfReadStru(DFile);
CASE ActionFile OF
TRUE :
BEGIN
ClrScr;
DbfDispStru(DFile);
Pause;
IF ActionHdr <> 2 THEN
BEGIN
ClrScr;
DbfList(DFile);
Pause
END
ELSE
BEGIN
ClrScr;
WriteLn('No records to print')
END
END;
FALSE :
BEGIN
Beep;
WriteLn('Field information error')
END
END {Case ActionFile}
END; {Case ActionHdr}
ActionFile := DbfClose(DFile);
END
END.