home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Shareware - Software Farm 2
/
wosw_2.zip
/
wosw_2
/
PASCAL
/
TP_DMX20.ZIP
/
DBENTRY.PAS
next >
Wrap
Pascal/Delphi Source File
|
1990-01-15
|
2KB
|
99 lines
Program DBENTRY;
{$V-,I- }
(*
This program uses dBrowser, from the DMXdFILE unit.
The DataAt function has been bypassed to get records from
the disk, one-at-a-time. dBwindow, the descendant object,
uses a virtual method (SetUpRecord) to display the current
record number.
*)
uses Dos, Crt, DMX2, DMXdFILE;
type
dBwindow = object (dBrowser)
procedure SetUpRecord (RecNum : longint);
virtual;
end;
const
testfilename = 'base.dbf';
maintitle = ' Account ref balance';
baseformat = ' CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC| CCC |($NNN,NNN.NN)';
basesize = 54 * 1000; { database size limit (in characters) }
Spc = #32;
cr = #13;
var Key,ext : char;
(* Note that the record structure doesn't actually need to be declared. *)
testdata : char;
{ testdata is not actually accessed by DMX because the
internal functions are bypassed in DMXdFILE.PAS }
DataWindow : dBwindow;
{ ─────────────────────────────────────────────────────────────────────── }
procedure dBwindow.SetUpRecord (RecNum : longint);
{ this virtual method displays the record number at the bottom of the screen }
var AStr : string;
begin
Str (currentrec + 1:4, AStr);
Screen (AStr + ' ', 24,11, fieldcolor);
end;
{ ─────────────────────────────────────────────────────────────────────── }
procedure WorkWindow (TopStr,FmtStr, Filename : pathstr);
begin
TextAttr := $3B;
MkBorder (1,9, 25,71, LightCyan);
Window (10,2,70,24);
ClrScr;
DataWindow.Init (TopStr, FmtStr, 2,2, $3B,$3F,$70);
DataWindow.dBASEinit (testfilename);
DataWindow.OpenBuffer (testdata, basesize);
DataWindow.EditData (testdata, Key,ext, [^C,#27],[]);
DataWindow.dBASEclose;
end;
{ ─────────────────────────────────────────────────────────────────────── }
Begin
BeepOn := True;
TextAttr := LightCyan;
ClrScr;
WorkWindow (maintitle, baseformat, testfilename);
TextAttr := LightCyan;
Window (1,1,80,25);
ClrScr;
GotoXY (1,4);
End.