home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / prof_c / 13ansi / sc_cmds.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-08-11  |  1.1 KB  |  42 lines

  1. /*
  2.  *    sc_cmds -- display command summary
  3.  */
  4.  
  5. #include <stdio.h>
  6. #include <local\ansi.h>
  7.  
  8. void
  9. sc_cmds(fg, bkg, bdr)
  10. int fg, bkg, bdr;
  11. {
  12.     static char *color_xlat[] = {
  13.         "Black (0)", "Blue (1)", "Green (2)", "Cyan (3)",
  14.         "Red (4)", "Magenta (5)", "Brown (6)", "White (7)",
  15.         "Grey (8)", "Light blue (9)", "Light green (10)",
  16.         "Light cyan (11)", "Light red (12)", "Light magenta (13)",
  17.         "Yellow (14)", "Bright white (15)"
  18.     };
  19.  
  20.     ANSI_CUP(2, 29);
  21.     fputs("*** SetColor (SC) ***", stdout);
  22.     ANSI_CUP(4, 17);
  23.     fputs("Attribute  Decrement  Increment  Current Value", stdout);
  24.     ANSI_CUP(5, 17);
  25.     fputs("---------  ---------  ---------  -------------", stdout);
  26.     ANSI_CUP(6, 17);
  27.     fputs("Foreground    F1         F2", stdout);
  28.     ANSI_CUP(7, 17);
  29.     fputs("Background    F3         F4", stdout);
  30.     ANSI_CUP(8, 17);
  31.     fputs("Border        F5         F6", stdout);
  32.     ANSI_CUP(6, 50);
  33.     fputs(color_xlat[fg], stdout);
  34.     ANSI_CUP(7, 50);
  35.     fputs(color_xlat[bkg], stdout);
  36.     ANSI_CUP(8, 50);
  37.     fputs(color_xlat[bdr], stdout);
  38.     ANSI_CUP(10, 17);
  39.     fputs("Type RETURN to exit. SetColor/Version 2.2", stdout);
  40.     return;
  41. }
  42.