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,682 of 2,978    |
|    Schjaer to Bart    |
|    Re: Correct screen colors not restored a    |
|    28 Aug 08 13:35:35    |
   
   From: jsj@nospambyg.dtu.dk   
      
   "Bart" wrote in message   
   news:0192b45eiuafcrihmvs3aarrh956ebchg6@4ax.com...   
   > Op Fri, 22 Aug 2008 13:51:35 +0200 schreef "Schjaer"   
   > :   
   >   
   >>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?   
   >>   
   >>Jorgen   
   >>   
   > Do you save and restore the current videomode?   
   >   
   > In plain DOS...   
   >   
   > var CurrentMode: Byte Absolute $0000:$0449;   
   > SavedMode: Byte;   
   >   
   > Somewhere at startup   
   > ...   
   > SavedMode := CurrentMode;   
   > ...   
   >   
   >   
   > Somewhre at cleanup in the end   
   >   
   > ...   
   > if CurrentMode <> VMode then TextMode(SavedMode);   
      
   I can't use the TextMode procedure because it clears the screen. Besides,   
   according to the TP 7 manual it hasn't got anything to do with colors, only   
   with the number of screen lines, etc. Do you think it affects the colors   
   after exiting a Pascal program?   
      
   --- 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