Program TSTRDEF;

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


Testing P3UTIL module(s): RDEF

}

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

{$list}

VAR
  i:integer;
  f:event_flag;
  s:boolean;

BEGIN
  Write('rdef test. enter flag number, 0 to exit.');
  readln(i);
  if i > 0 then 
  repeat
    if i > 96 then writeln('illegal flag, try again')
    else
      BEGIN 
      f := loophole(event_flag,i);
      s := rdef(f);
      if ($dsw = 0) and (i > 64) then writeln('group globals don''t exist');
      if $DSW < 0 then sayerr($DSW -128);
      if s then writeln('SET') else writeln('CLEAR')
      END;
    write('enter flag or 0 to exit:');
    readln(i);
  until i=0;
writeln('end of test')
end.	
