Procedure Show_DataBase (Source:tDataBase;RecordCount:Integer);
{ ***************************************************
Represents the Information in a DataBase as a Table
*************************************************** }
Var a,Turn:Integer;
Begin
Turn:=0;
Window(1,25,80,25);
WriteLn ('Total: ',RecordCount,' Record(s)');
Window(1,1,80,22);
For a:=1 To RecordCount Do
Begin
With Source[a] Do
WriteLn (FamilyName:15,' ',Name:10,' ',TelephoneNumber:15,' ',Address:35);
Turn:=Turn+1;
If Turn=20 Then
Begin
Turn:=0;
Write ('Press Enter to view the next Page...');
ReadLn;
ClrScr;
End
Else WriteLn;
End;
End;
Procedure Enter_DataBase (Var Destination:tDataBase;Var RecordsCount:Integer);
{ **********************************************************
Procedure fills Destination-DataBase with Records from the
specified File.
********************************************************** }
Var DataBaseFile:File of tFriend;
NextIndex:Integer;
Source:String;
Begin
Write ('Enter the DataBase File Name: ');
ReadLn (Source);
{$I-}
Assign(DataBaseFile,Source);
Reset(DataBaseFile);
{$I+}
If IOResult=0 Then
Begin
While Not Eof(DataBaseFile) Do
Begin
NextIndex:=NextIndex+1;
Read (DataBaseFile,Destination[NextIndex]);
End;
RecordsCount:=NextIndex;
Close (DataBaseFile);
WriteLn;
WriteLn (' DataBase has been read Successfully!')
End
Else
WriteLn (' Achtung! It`s impossible to open the specified File!');
End;
Procedure Save_DataBase (Source:tDataBase;RecordCount:Integer);
Уважаемый посетитель!
Чтобы распечатать файл, скачайте его (в формате Word).
Ссылка на скачивание - внизу страницы.