Program TSTrdxf;

{ Version
  File:[22,310]TSTrdxf.PAS
  Author: Jim Bostwick 21-OCT-83
  History:


Testing P3UTIL module(s):  rdxf, SETF, CLEF

}

{$nolist}
{[a+,b+,l-,k+,r+] Pasmat }
%INCLUDE 'EX:[22,320]GENERAL3.TYP';
%INCLUDE 'EX:[22,320]rdxf.EXT';
%INCLUDE 'EX:[22,320]CLEF.EXT';
%INCLUDE 'EX:[22,320]SETF.EXT';
%INCLUDE 'EX:[22,320]SAYERR.EXT';
{$list}


VAR
  Efn:Event_Flag;
  Flags:Event_Flag_set;
  i:integer;

Procedure Dump_flags;

Var
  f:event_flag;

BEGIN
  for f := f1 to f96 do
    BEGIN 
    if f in Flags then write(ord(f):3)
       else write(' ');
    if f in [f16, f32, f48, f64, f80, f96] then writeln
    END
end;

BEGIN
  writeln('rdxf test.');
  writeln('first, set all flags..');
  for efn := f1 to f96 do 
    BEGIN 
    setf(efn);
    if $dsw < 0 then sayerr($DSW - 128)
    END;
  writeln('now read them');
  rdxf(flags);
  if $dsw < 0 then sayerr($DSW - 128);
  Dump_flags;
  writeln('now clear all odd flags');
  efn := f1;
  while efn < f94 do
    BEGIN 
    clef(efn);
    if $dsw < 0 then sayerr($dsw - 128);
    efn := succ(efn);
    efn := succ(efn) { skip two flags}
    END;
  clef(f95);
  rdxf(flags);
  if $dsw < 0 then sayerr($DSW - 128);
  dump_Flags;
  writeln('clean up, clear all globals');
  for efn := f32 to f64 do clef(efn);
  rdxf(flags);
  if $dsw < 0 then sayerr($dsw - 128);
  dump_flags;
  writeln('end of test.')
end.
