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,679 of 2,978    |
|    Bart to All    |
|    Re: Correct screen colors not restored a    |
|    24 Aug 08 11:08:07    |
   
   From: broersma.juda_ANTISPAM_@tiscali.nl   
      
   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);   
    ...   
      
   This has worked for me in the past.   
      
   Bart   
      
      
   --   
   Bart Broersma   
   broersma.juda_ANTISPAM_@tiscali.nl   
   (ff _ANTISPAM_ wegpoetsen uit dit adres natuurlijk)   
      
   --- 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