Path: utzoo!mnetor!uunet!husc6!bloom-beacon!mit-eddie!uw-beaver!cornell!rochester!ritcv!mds7958 From: mds7958@ritcv.UUCP (Mark Sicignano) Newsgroups: comp.sys.ibm.pc Subject: Re: Bat file using ESC seq needs to find if DEVICE=ANSI.SYS was set Message-ID: <386@ritcv.UUCP> Date: 13 Apr 88 19:14:28 GMT References: <767@ms3.UUCP> <28501@linus.UUCP> <196@lafcol.UUCP> Organization: Rochester Institute of Technology, Rochester, NY Lines: 20 > In article <28501@linus.UUCP>, jcmorris@mitre-bedford.ARPA (Joseph C. Morris) writes: > > In article <767@ms3.UUCP> msicv01@ms3.UUCP (Jay G. Heiser) writes: > > >...I need a way to test before using any ESC sequences > > >whether or not the [ANSI.SYS] driver has been set. How can I do that? > > > Here's a fragment of C code which works for me. It compiles under > MS C 5.0: > > union REGS inregs,outregs; > > printf("\n\033[2J"); /* prints a newline and then tries to clear the screen */ I don't think this will work? At least not on my version of MS-DOS (3.1) Even without ansi.sys installed, the \003[2J sequence still clears my screen and puts the cursor at HOME position. However the escape sequence \003[H is only recognized when ansi.sys is used, so this will work. -mark