🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.ibm.pc
Article #26370

Re: Bat file using ESC seq needs to find if DEVICE=ANSI.SYS was set

#26370
From: Slaght Ralph L
Date: Tue, 12 Apr 1988 15:10
26 lines
1798 bytes
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 seq-
> >uences 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 */
inregs.h.ah = 3;
inregs.h.bh = 0;
int86(0x10,&inregs,&outregs);
if (outregs.h.dh != 0) /* if cursor is not at top of screen then...*/
	{
	printf("ANSI.SYS is not loaded on this system.  In order for the\n");
   printf("program to work properly you must have ANSI.SYS on the system, and\n");
   printf("you must have a line in your CONFIG.SYS file which reads:\n");
   printf("      device=ansi.sys                                   \n");
   printf("\nAfter inserting such a line into your CONFIG.SYS file, please\n");
   printf("reset your system and rerun  .......\n");
   printf("\n***********Hit any key to exit******************");
   ch = getch();
	exit(1);
   }
Technical Details
Message-ID: <196@lafcol.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!ll-xn!mit-eddie!uw-beaver!cornell!rochester!udel!burdvax!bpa!cbmvax!vu-vlsi!lehi3b15!lafcol!slaghtrl
References: <767@ms3.UUCP> <28501@linus.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!ll-xn!mit-eddie!uw-beaver!cornell!rochester!udel!burdvax!bpa!cbmvax!vu-vlsi!lehi3b15!lafcol!slaghtrl
From: slaghtrl@lafcol.UUCP (Slaght Ralph L)
Newsgroups: comp.sys.ibm.pc
Subject: Re: Bat file using ESC seq needs to find if DEVICE=ANSI.SYS was set
Message-ID: <196@lafcol.UUCP>
Date: 12 Apr 88 15:10:11 GMT
References: <767@ms3.UUCP> <28501@linus.UUCP>
Organization: Academic Computer Center, Lafayette College
Lines: 25
Keywords: ansi.sys, Escape Sequences, errorlevel, find, grep, DOS, unix
Summary: checking to see if ANSI.SYS is loaded