home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.pascal.borland      Borland Pascal was actually pretty neat      2,978 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 2,685 of 2,978   
   Schjaer to Schjaer   
   Re: Correct screen colors not restored a   
   01 Sep 08 14:07:27   
   
   5d586f6f   
   From: jsj@nospambyg.dtu.dk   
      
   "Jim Leonard"  wrote in message   
   news:73c1404a-b9eb-4690-8e14-7d2c50b4705b@k37g2000hsf.googlegroups.com...   
   On Aug 28, 6:23 am, "Schjaer"  wrote:   
   > "Jim Leonard"  wrote in message   
   >   
   > news:a186b1b0-ec00-4eab-8b0f-22d2c39ce821@56g2000hsm.googlegroups.com...   
   >   
   >   
   >   
   > > On Aug 22, 6:51 am, "Schjaer"  wrote:   
   > >> Hi group   
   >   
   > >> After exiting a DOS program that manipulates the screen colors I   
   > >> sometimes   
   > >> (but not always) don't get the same colors back that existed before   
   > >> invoking   
   > >> the program. I have tried to save then restore TextAttr within the   
   > >> program   
   > >> but that seems to have no effect. I have observed this in both Turbo   
   > >> Pascal   
   > >> 7.0 and FreePascal. It seems to be a question of sheer luck if the   
   > >> original   
   > >> screen colors are restored or not at exit. Any suggestions?   
   >   
   > > Incorrect colors are the result of MS-DOS painting just the characters   
   > > while leaving the color attributes alone.   
   >   
   > But what colors does MS-DOS use to paint the characters?   
      
   It doesn't use color, it only prints characters.  That's why, if the   
   screen was recolored, the characters will show up using the previous   
   coloring.   
      
   > >Your DOS program probably   
   > > recolors the entire screen, then dumps you at the prompt without   
   > > cleaning up.   
   >   
   > No, I save TextAttr upon entry then restore it just before exit.   
      
   That's internal to CRT only.   
      
   What you should be doing is saving the screen contents when starting,   
   then restoring them on exit (along with the correct screen mode and   
   cursor location).   
      
   That sounds like the solution. How does one do that?   
      
   Jorgen   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca