Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!unmvax!nmtsun!jrwsnsr From: jrwsnsr@nmtsun.nmt.edu (Jonathan R. Watts) Newsgroups: comp.lang.pascal Subject: Re: Reverse Video in Turbo Pascal Keywords: reverse video Message-ID: <3341@nmtsun.nmt.edu> Date: 18 Oct 89 07:56:32 GMT References: <40680@bu-cs.BU.EDU> Organization: New Mexico Tech, Socorro NM Lines: 22 In article <40680@bu-cs.BU.EDU>, tasos@bu-cs.BU.EDU (Anastasios Kotsikonas) writes: > Does anyone know how to write characters in reverse video in Turbo Pascal > using the crt unit? I know it doesn't work with the usual escape sequence. > Strangly enough, the escape sequence works without the crt unit. The reason the escape sequences work WITHOUT the crt unit is that then they go through ANSI.SYS, which is what decodes them. With the crt unit installed, output is written directly to screen memory, which is faster, BECAUSE it bypasses the bios, including ANSI. To write reverse video in TP you could use TextAttr := (TextAttr shr 4) + (TextAttr shl 4); This should switch the foreground and background colors. Note that this won't work if you had the high-intensity bit set before-hand; you'll end up with blinking text. Conversely, if the text was blinking, it will become high-intensity. Sigh! - Jonathan Watts jrwsnsr@nmtsun.nmt.edu