Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!me!zougas From: zougas@me.utoronto.ca ("Athanasios(Tom) Zougas") Newsgroups: comp.lang.pascal Subject: Re: Reverse Video in Turbo Pascal Summary: a solution Keywords: reverse video Message-ID: <89Oct18.122326edt.18681@me.utoronto.ca> Date: 18 Oct 89 16:23:15 GMT References: <40680@bu-cs.BU.EDU> <3341@nmtsun.nmt.edu> Organization: Mechanical Engineering, U of Toronto Lines: 28 In article <3341@nmtsun.nmt.edu> jrwsnsr@nmtsun.nmt.edu (Jonathan R. Watts) writes: >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); A better way is to set directvideo := false; in you initialization. This will cause the output to NOT bypass bios and thus, will be decoded by the ANSI driver. The same thing will allow you to use 'write' and 'writeln' in graphics mode and actually get text on the screen, for the same reason. Tom. -- I can be reached at... INTERNET: zougas@me.utoronto.ca USENET: zougas@me.toronto.edu BITNET: zougas@ME.UTORONTO.BITNET UUCP: ...!utai!me!zougas