Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!cornell!rochester!uhura.cc.rochester.edu!ur-valhalla!davis From: davis@mercury.ee.rochester.edu (Al Davis) Newsgroups: comp.binaries.ibm.pc.d Subject: Re: changing switch char Summary: replacement "system" call for msc Message-ID: <1594@valhalla.ee.rochester.edu> Date: 18 Nov 88 01:28:53 GMT References: <4803@bsu-cs.UUCP> Sender: usenet@valhalla.ee.rochester.edu Reply-To: davis@mercury.ee.rochester.edu (Al Davis) Organization: UR Dept. of Electrical Engg, Rochester NY 14627 Lines: 36 Here is a replacement system function for msc, that supports switchar. If only they would read their own documentation. (instead of IBM's??) Note: if you look in THEIR docs, switchar is documented. int system(string) const char *string; { char *shell; char args[200]; int errcod; if ( !(shell=getenv("COMSPEC")) ) return 127; sprintf(args,"%cc %s",getswitchar(),string); errcod = spawnle(P_WAIT, shell, shell, args, NULL, environ); _fpreset(); if (errcod == EOF) return 127; return 0; } /*--------------------------------------------------------------------------*/ char getswitchar() { union REGS r; r.h.al = 0; r.h.ah = 0x37; intdos(&r, &r); return r.h.dl; }