{<<<< WriteAt >>>>}
{ From: COMPLETE TURBO PASCAL by Jeff Duntemann  }
{ Scott, Foresman & Co. 1986  ISBN 0-673-18600-8 }
{ Described in section 17.2 -- Last mod 2/1/86   }

PROCEDURE WriteAt(X,Y : Integer;
                  Highlite : Boolean;
                  UseCR    : Boolean;
                  TheText  : String255);

BEGIN
  IF Y < 0 THEN Y := 12;
  IF X < 0 THEN X := (80-Length(TheText)) DIV 2;
  GotoXY(X,Y);
  IF Highlite THEN LowVideo;
  IF UseCR THEN Writeln(TheText) ELSE Write(TheText);
  NormVideo
END;
