Correct screen colors not restored after exiting a pascal program

This is a discussion on Correct screen colors not restored after exiting a pascal program within the Pascal forums in Programming Languages category; On 2008-08-28, Jim Leonard <MobyGamer @ gmail.com> wrote: >> > 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. IIRC it does partially. In general you are right, but (either dos or bios) has some color to fill newly inserted lines with....

Go Back   Application Development Forum > Programming Languages > Pascal

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #11  
Old 09-01-2008, 08:16 AM
Marco van de Voort
Guest
 
Default Re: Correct screen colors not restored after exiting a pascal program

On 2008-08-28, Jim Leonard <MobyGamer@gmail.com> wrote:
>> > 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.


IIRC it does partially. In general you are right, but (either dos or bios)
has some color to fill newly inserted lines with.

Reply With Quote
  #12  
Old 09-01-2008, 01:35 PM
Dr J R Stockton
Guest
 
Default Re: Correct screen colors not restored after exiting a pascal program

In comp.lang.pascal.borland message <g9glu0$t59$1@news.net.uni-c.dk>,
Mon, 1 Sep 2008 14:07:27, Schjaer <jsj@nospambyg.dtu.dk> posted:
>
>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?


<URL:http://www.merlyn.demon.co.uk/programs/shower.pas> does that.

--
(c) John Stockton, nr London UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/&c., FAQqy topics & links;
<URL:http://www.merlyn.demon.co.uk/clpb-faq.txt> RAH Prins : c.l.p.b mFAQ;
<URL:ftp://garbo.uwasa.fi/pc/link/tsfaqp.zip> Timo Salmi's Turbo Pascal FAQ.
Reply With Quote
  #13  
Old 09-11-2008, 04:09 PM
etrsek@gmail.com
Guest
 
Default Re: Correct screen colors not restored after exiting a pascal program

On 22 Srp, 13:51, "Schjaer" <j...@nospambyg.dtu.dk> 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 TurboPascal
> 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?
>
> Jorgen


See www.trsek.com/pas/trsek procedure put_window, get_window. It's
solve your problem.
TrSek
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 08:12 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.