home *** CD-ROM | disk | FTP | other *** search
/ POINT Software Programming / PPROG1.ISO / pascal / swag / screen.swg / 0012_SCRWRIT2.PAS.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1993-05-28  |  2.4 KB  |  72 lines

  1. {
  2.  SO> Got a question For you all out there..... How the heck can I Write a
  3.  SO> Character  into the bottom right corner of a Window without the Window
  4.  SO> scrolling?
  5.  SO>
  6.  SO> if anyone knows some way to keep the Write command from Forwarding the
  7.  SO> cursor  position Pointer, that would be fine enough For me.....
  8.  
  9. Sean, here is a way to do it without resorting to poking the screen.
  10. }
  11.  
  12. {$A+,B+,D+,E-,F+,G-,I+,L+,N-,O+,P+,Q+,R+,S+,T-,V-,X+,Y+}
  13. {$M 8192,0,0}
  14.  
  15. Uses
  16.   Crt;
  17. Var
  18.   index1, Index2: Byte;
  19.  
  20. begin
  21.   ClrScr;
  22.  
  23. {******************************************
  24.  First Write top line of bordered display
  25. ******************************************}
  26.  
  27.   Write ('╔');                     {Write top Left Corner}
  28.   For Index1 := 1 to 78 do         {Write top Horizontal line }
  29.     Write ('═');
  30.   Write ('╗');                     {Write top Right Corner}
  31.  
  32. {*******************************************
  33.  Now Write Bottom line of bordered display
  34. *******************************************}
  35.  
  36.   Write ('╚');                     {Write Bottom Left Corner}
  37.   For Index1 := 1 to 78 do         {Write Bottom horizontal line}
  38.     Write ('═');
  39.   Write ('╝');                     {Write Bottom Right Corner}
  40.  
  41. {********************************************************************
  42.  Now inSERT 23 lines of Left&Right bordered display, pushing bottom
  43.  line down as we do
  44. ********************************************************************}
  45.  
  46.   For Index1 := 1 to 23 do begin   { Repeat 23 times }
  47.     GotoXY (1, 2);                 {Move cursor back to Col 1, Line 2}
  48.     InsLine;                       {Insert blank line (Scroll Text down)}
  49.     Write ('║');                   {Write Left border vertical caracter}
  50.     For Index2 := 1 to 78 do       {Write 78 spaces}
  51.       Write (' ');
  52.     Write ('║');                   {Write Right border vertical caracter}
  53.   end;
  54.  
  55. {***********************************************************
  56.  I added this so the Program would pause For a key. This way
  57.  it will allow you to see that it does not scroll up since
  58.  the cursor never Writes to position 25,80
  59. ***********************************************************}
  60.  
  61.   Asm                              {Assembler code to flush keyboard}
  62.     mov Ax, 0C00h;
  63.     Int 21h;
  64.   end;
  65.   ReadKey ;                        {Wait For a keypress}
  66.  
  67. end.
  68.  
  69. {
  70. BTW, this was written, Compiled and Tested in BP 7.0 but should work in
  71. TP 4.0 and up if you remove the Assembler stuff.
  72. }