home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / c / 12586 < prev    next >
Encoding:
Internet Message Format  |  1992-08-20  |  1.4 KB

  1. Xref: sparky comp.lang.c:12586 comp.sys.ibm.pc:434
  2. Newsgroups: comp.lang.c,comp.sys.ibm.pc
  3. Path: sparky!uunet!emba-news.uvm.edu!moose.uvm.edu!cblaise
  4. From: cblaise@moose.uvm.edu.UUCP (Chris Blaise)
  5. Subject: Re: Using ANSI.SYS codes from C?  (Turbo)
  6. Message-ID: <1992Aug20.193006.11669@uvm.edu>
  7. Originator: cblaise@moose.uvm.edu
  8. Sender: news@uvm.edu
  9. Organization: University of Vermont -- Division of EMBA Computer Facility
  10. References: <1992Aug18.013912.12547@cs.umb.edu>
  11. Date: Thu, 20 Aug 1992 19:30:06 GMT
  12. Lines: 28
  13.  
  14. From article <1992Aug18.013912.12547@cs.umb.edu>, by cteague@ra.cs.umb.edu (Charles F. Teague II):
  15. >   Is there any way to use ANSI.SYS escape sequences from C?  (TurboC++v1.0)
  16. > I'm hoping to use this just to get a simple coloring of my text, without
  17. > using conio.h, and staggering cprintf()s with textcolor() and/or textattr().
  18. >   I've tried several different output fns, and none of them seem to be able
  19. > to do what a simple echo command in a batch file can do:  change the text
  20. > color by using ansi codes.  If anyone can help me out, I'd appreciate it.
  21.  
  22.  
  23.     Yes, it is possible.  I created my header file using Qedit,
  24. > character (control-P <esc>).  My ANSIVT.H file looks something like:
  25.  
  26.  #define CURSORUP(X)    "<esc>["X"A"
  27.  and other VT escape codes...
  28.  
  29.  Color works out like:
  30.  
  31.  #define RED         "<esc>[31m"
  32.  
  33.  Works out real slick....
  34.  
  35.  TTYL
  36.  Chris
  37.  
  38. simply because it was easier to make the <esc
  39.