home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / magazine / insidetp / 1990_08 / letter.pas < prev    next >
Pascal/Delphi Source File  |  1990-06-20  |  1KB  |  56 lines

  1. { This program tests the hint of incrementing
  2.   the WindMax variable before writing to the lower
  3.   right corner-location (80,25). This suppresses
  4.   the annoying scroll that normally occurs in that
  5.   location. Submitted by Paul D. Hanus}
  6.  
  7. PROGRAM Hint;
  8. USES
  9.     Crt;
  10. PROCEDURE Border(X1,Y1,X2,Y2 : Byte);
  11. VAR
  12.   I : Byte;
  13.   NRows : Byte;
  14.   NColumns : Byte;
  15. BEGIN
  16.   NColumns := X2 - X1 + 1;
  17.   NRows := Y2 - Y1 + 1;
  18.   Window(X1,Y1,X2,Y2);
  19.   GotoXY(1,1); Write(#201);  { upper left }
  20.   GotoXY(1,NRows); Write(#200);  { lower left }
  21.   GotoXY(NColumns,1); Write(#187); { upper right }
  22.  
  23.   { start trick here to write lower right}
  24.   Inc(WindMax);
  25.   GotoXY(NColumns,NRows); Write(#188);
  26.   { reset so normal scrolling can occur }
  27.   Dec(WindMax);
  28.  
  29.   FOR I := 2 TO (NColumns - 1) DO
  30.     BEGIN
  31.       GotoXY(I,1); Write(#205);
  32.       GotoXY(I,NRows); Write(#205);
  33.     END;
  34.  
  35.   FOR I := 2 TO (NRows - 1) DO
  36.     BEGIN
  37.       GotoXY(1,I); Write(#186);
  38.       GotoXY(NColumns,I); Write(#186);
  39.     END;
  40. END;
  41. VAR
  42.   J : Byte;
  43. BEGIN
  44.   ClrScr;
  45.   Border(1,1,80,25);
  46.   Border(2,2,78,24);
  47.   Border(10,13,50,16);
  48.   Window(1,1,80,25);
  49.   FOR J := 1 TO 25 DO
  50.     BEGIN
  51.       GotoXY(4,J);Write(J:2)
  52.     END;
  53.   Write(' Press Enter to quit.');
  54.   ReadLn;
  55. END.
  56.