  { TUUTILS -- contains YESRESP, ASSERT, IS_SPECIAL, etc. }

  {**********************}
  function RESP(MSG: string80): char;
    var CH: char;
  begin
    write(msg);
    read(kbd, ch);  writeln(ch);
    resp:=ch;
    end;
  
  {*********************}
  function YESRESP (MSG: string80): boolean;
    var CH: char;
  begin
    yesresp:=resp(msg) in ['y', 'Y'];
    end;

  {*********************}
  procedure ESCAPE(code: integer);
  begin
    writeln;
    writeln('Fatal error; code ', code:1);
    writeln(rfile, ' ':255); halt(code);
    end;

  {********************}
  function StrCmp(S, T: string80): integer;
  { return -1 if s<t; 0 if s=t; 1 if s>t }
  var Result: integer;
  begin
         if s = t then StrCmp := 0
    else if s < t then StrCmp := -1
    else if s > t then StrCmp := 1
  end;

  {*********************}
  procedure ASSERT (COND: boolean; MSG: string80) ;
  begin
    if not(cond) then
    begin
      writeln;
      writeln('Internal assertion failure: ', msg);
      writeln('Please notify Support person in charge');
      escape(999)
    end
  end;

  {*********************}
  function NUM2STRING (N: integer): string8;
  var   S: string8;
        RETURNCODE: integer;
  begin
    s := '';
    str(n, s);
    num2string:=s;
  end;

  {*****************}
  procedure OPENCOM;
  begin
    end;

  {*****************}
  function OPENFILE(var TFILE: text;
                    FNAME: string80; FOR_WRITE: boolean): boolean;
    var SUCCESS: boolean;
        ERRCODE: integer;
  begin
   {$I-}
    assign(tfile, fname);
    if for_write then rewrite(tfile)
    else reset(tfile);
    success := (ioresult = 0);
    errcode := ioresult;
   {$I+}
    if not success then
      writeln('Can''t open file ', fname, ' -- code ', errcode:1);
    openfile:=success;
    end;

