home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / pascal / 5068 < prev    next >
Encoding:
Internet Message Format  |  1992-08-26  |  2.4 KB

  1. Path: sparky!uunet!dtix!darwin.sura.net!wupost!sdd.hp.com!ux1.cso.uiuc.edu!news.cso.uiuc.edu!s.psych.uiuc.edu!amead
  2. From: amead@s.psych.uiuc.edu (Alan Mead)
  3. Newsgroups: comp.lang.pascal
  4. Subject: Re: Prevent the screen from scrolling?
  5. Message-ID: <BtLrE5.K6H@news.cso.uiuc.edu>
  6. Date: 26 Aug 92 18:01:15 GMT
  7. References: <1992Aug26.153649.147@csghsg5a.bitnet>
  8. Sender: usenet@news.cso.uiuc.edu (Net Noise owner)
  9. Organization: UIUC Department of Psychology
  10. Lines: 54
  11.  
  12. 89612048s@csghsg5a.bitnet writes:
  13.  
  14. >How to prevent a screen from scrolling?
  15.  
  16. >If I am going to write anything into the last position of the screen
  17. >(80,25) or of a window, the screen is scrolling on line forward. Is there any 
  18. >possibility to prevent the screen from scrolling? Otherwise you
  19. >always have to take care that you never write into the last screen-
  20. >positio.
  21.  
  22. >Thank You very much for Your help.
  23.  
  24. >Markus
  25.  
  26. Yes.  My prefered way is to write to the screen directly.  The base address 
  27. of the screen is $B800 for a color adapter and $B000 for a mono.  The 
  28. structure of (text) video ram is:
  29.  
  30. type
  31.   cell_type = record
  32.                 character : char;
  33.                 attribute : byte;
  34.               end;
  35.  
  36. the 'attribute' field has exactly the same structure as Crt.TextAttr
  37.  
  38. Versions of TP up to 5.5 included a unit in the examples directory
  39. called WIN.PAS which had an asm routine to do this kind of stuff.  I
  40. don't know if it was included in v6.
  41.  
  42. The Technojock's Turbo Toolkit (available from wuarchive.wustl.edu last
  43. time i looked) had a similar (perhaps better) routine you might want to
  44. look at.  I didn't examine their Object Toolkit...
  45.  
  46. I think you can also modify the variable Crt.WindMax.  Something like this:
  47.   
  48.   Crt.WindMax := Crt.WindMax + 1;
  49.  
  50. This is the same as calling Window( ) with a larger Y2 except that
  51. window() will, reasonably, ignore any calls with invalid arguments.
  52. Also, what you're really doing is:  WM := (WM AND $FF00) OR (lo(WM)+1)
  53. (incrementing the LOW byte).  If the low byte should happen to be 254,
  54. (ie, if your screen has 254 lines in TEXT mode) then you're screwed.
  55.  
  56. The down side of this method is that TP will happily write to the 26th
  57. line.  I'm not sure what happens then...  Or, if you have a window, then
  58. it writes onto the next line (maybe a frame or part of another window).
  59. Also, if you do a ClrScr, it will try to clear that extra line too...
  60.  
  61.  
  62. But on the plus side, the other method will ignore the current window
  63. (since it is screen relative, not dependant on the BIOS).
  64.  
  65. -alan mead
  66.