home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / adav313.zip / gnat-3_13p-os2-bin-20010916.zip / emx / gnat / examples / screen.adb < prev    next >
Text File  |  2000-07-19  |  960b  |  40 lines

  1. --::::::::::
  2. --screen.adb
  3. --::::::::::
  4. with Text_IO;
  5. package body Screen is
  6.  
  7.   -- simple ANSI terminal emulator
  8.   -- Michael Feldman, The George Washington University
  9.   -- July, 1995
  10.  
  11.   -- These procedures will work correctly only if the actual
  12.   -- terminal is ANSI compatible. ANSI.SYS on a DOS machine
  13.   -- will suffice.
  14.  
  15.   package Int_IO is new Text_IO.Integer_IO (Num => Integer);
  16.  
  17.   procedure Beep is
  18.   begin
  19.     Text_IO.Put (Item => ASCII.BEL);
  20.   end Beep;
  21.  
  22.   procedure ClearScreen is
  23.   begin
  24.     Text_IO.Put (Item => ASCII.ESC);
  25.     Text_IO.Put (Item => "[2J");
  26.   end ClearScreen;
  27.  
  28.   procedure MoveCursor (To: in Position) is
  29.   begin                                                
  30.     Text_IO.New_Line;
  31.     Text_IO.Put (Item => ASCII.ESC);
  32.     Text_IO.Put ("[");
  33.     Int_IO.Put (Item => To.Row, Width => 1);
  34.     Text_IO.Put (Item => ';');
  35.     Int_IO.Put (Item => To.Column, Width => 1);
  36.     Text_IO.Put (Item => 'f');
  37.   end MoveCursor;  
  38.  
  39. end Screen;
  40.