home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 300-399 / ff339.lzh / PCQ / Examples / ANSI.p < prev    next >
Text File  |  1990-03-19  |  1KB  |  69 lines

  1. Program ANSIThing;
  2.  
  3. {
  4.     This program demonstrates a few of the features of the console
  5.     made possible by ANSI codes.
  6. }
  7.  
  8.     Procedure Delay(f : Integer);
  9.     External;
  10.     Function strlen(s : String) : Integer;
  11.     External;
  12.  
  13. procedure GotoXY(x, y : Short);
  14. begin
  15.     Write('\c', y, ';', x, 'H');
  16. end;
  17.  
  18. Procedure ClrEOL;
  19. begin
  20.     Write('\cK');
  21. end;
  22.  
  23. Procedure ClrScr;
  24. begin
  25. {
  26.     GotoXY(1, 1);
  27.     Write('\cJ');
  28. }
  29.     Write(Chr(12));
  30. end;
  31.  
  32. Procedure Insert(s : String);
  33. begin
  34.     Write('\c', StrLen(s), Chr($40));
  35.     Write(s);
  36. end;
  37.  
  38. var
  39.     I : integer;
  40. begin
  41.     GotoXY(50, 12);
  42.     Delay(20);
  43.     GotoXY(60, 14);
  44.     Delay(20);
  45.     GotoXY(4, 4);
  46.     Delay(20);
  47.     GotoXY(1,1);
  48.     for I := 1 to 20 do
  49.     Writeln('This is thejlasdflskajdflsadjflsakjdfsldjf');
  50.     for I := 1 to 20 do begin
  51.     GotoXY(5, I);
  52.     Delay(20);
  53.     ClrEOL;
  54.     Delay(20);
  55.     end;
  56.     ClrScr;
  57.     Delay(20);
  58.     for I := 1 to 20 do
  59.     Writeln('ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890');
  60.     Delay(20);
  61.     for I := 1 to 8 do begin
  62.     GotoXY(4,4);
  63.     Delay(20);
  64.     Insert("Froombaba");
  65.     end;
  66.     Delay(20);
  67.     GotoXY(1,21);
  68. end.
  69.