program InitVideoDataBase;
(*$A+,C-,R-,V-*)

const

  maxanzcass = 100;
  leer = -1;
(*  data record Size definition *)
  TitelrecSize  =  80;              (*  record Size *)

(*  TURBO-access constants *)
  MaxDataRecSize  =  TitelRecSize;  (*  max record Size *)
  MaxKeyLen       =  40;            (*  max key Size *)
  PageSize        =  16;            (*  page Size *)
  Order           =  8;             (*  half page Size *)
  PageStackSize   =  15;            (*  page buffer Size *)
  MaxHeight       =  5;             (*  max B-tree height *)


var
  NoOfRecs      : Integer;

(*  include TURBO-access modules *)

(*$I ACCESS.BOX*)
(*$I GETKEY.BOX*)
(*$I ADDKEY.BOX*)
(*$I DELKEY.BOX*)

type
  Str4    =  string[4];
  Str5    =  string[5];
  Str8    =  string[8];
  Str10   =  string[10];
  Str15   =  string[15];
  Str20   =  string[20];
  Str25   =  string[25];
  Str40   =  string[40];
  Str80   =  string[80];
  AnyStr  =  string[255];

(*  character set type *)
  CharSet=  set of Char;


  cassrec = record
              cassart: Str20;
              titelref:   array [1..12] of integer;
            end;
  cassrecfile = file of cassrec;


var

(*  global variables *)
  DatF           : DataFile;
  IndexF         : IndexFile;
  Ch             : Char;
  cassrecf       : file of cassrec;
  cr             : cassrec;
  i              : integer;

begin
  cr.cassart:='';
  for i:=1 to 12 do
    cr.titelref[i]:=leer;
  assign(cassrecf,'cf.dat');
  rewrite(cassrecf);
  for i:=0 to maxanzcass do
    begin
      seek(cassrecf,i);
      write(cassrecf,cr);
    end;
  close(cassrecf);

  makefile(datf,'t.dat',TitelrecSize);

  initindex;
  makeindex(indexf,'ti.dat',MaxKeyLen,0);
  closeindex(indexf);
  closefile(datf);

end.



