program region;

{
File		: DE:[22,311]REGION.PAS;
Author		: Peter Stadick
Origin Date	: DEC 16,88

       Last Edit: 17-DEC-1988 14:22:04 

Description:

}

%include lb:[22,320]general3.typ;
%include de:[22,320]region.typ;
%include de:[22,320]regcre.ext;
%include de:[22,320]atrgpa.ext;
%include de:[22,320]dtrgpa.ext;
%include de:[22,320]regwin.ext;
%include de:[22,320]crawpa.ext;
%include de:[22,320]elawpa.ext;
%include de:[22,320]mappa.ext;
%include de:[22,320]umappa.ext;

type
  apr5_point	= ^test_data;

  test_data = packed array [1..20] of char;

var
  rdb	: rdb_type;
  wdb	: wdb_type;
  i	: integer;
  apr5	: apr5_point;

begin

  regcre(rdb,8192,'PETERS','   GEN',31,0);
  writeln('DSW ',$dsw);
  write('CREATE RDB:');
  for i := 1 to 8 do
    write(rdb[i]);
  writeln;
  readln(i);  

  atrgpa(rdb);
  writeln('DSW ',$dsw);
  write('ATRGPA RDB:');
  for i := 1 to 8 do
    write(rdb[i]);
  writeln;
  readln(i);

  regwin(wdb,5,20,rdb[1],0,20,420B,0);
  crawpa(wdb);
  writeln('DSW ',$dsw);
  write('CRAWPA WBD:');
  for i := 1 to 8 do
    write(wdb[i]);
  writeln;
  readln(i);

  mappa(wdb);
  writeln('DSW ',$dsw);
  write('MAPPA  WBD:');
  for i := 1 to 8 do
    write(wdb[i]);
  writeln;
  readln(i);

  { now lets write sometime to he region. }
  { First we must point to it. }
  apr5 := loophole(apr5_point,120000B);
  while i > 0 do
  begin
    readln(i);
    writeln(apr5^);
  end;

  umappa(wdb);
  writeln('DSW ',$dsw);
  write('UMAPPA  WBD:');
  for i := 1 to 8 do
    write(wdb[i]);
  writeln;
  readln(i);

  elawpa(wdb);
  writeln('DSW ',$dsw);
  write('ELAWPA WBD:');
  for i := 1 to 8 do
    write(wdb[i]);
  writeln;
  readln(i);

  dtrgpa(rdb);
  writeln('DSW ',$dsw);
  write('DTRGPA RDB:');
  for i := 1 to 8 do
    write(rdb[i]);
  writeln;
  readln(i);
end.
