home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / sliphw.zip / sc.cmd < prev    next >
OS/2 REXX Batch file  |  1995-10-02  |  2KB  |  51 lines

  1. @echo off
  2. if not x%1==x set color=%1
  3. if not x%color%==x goto parm
  4. echo No color specified
  5. echo Syntax: %0 foreground background
  6. echo Color options are WYMRCGBwymrcgbx. Uppercase=intense color.
  7. goto end
  8. :parm
  9. rem ---------------------------------------------------------------------
  10. rem You must explicitly set up the colors you want to use.
  11. rem This CMD file must branch to code that sets an ANSI code in the prompt
  12. rem which matches the color set by COLOR.EXE.
  13. rem
  14. rem How to set up colors
  15. rem
  16. rem Background values. Set b to one of these:
  17. rem 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=gray
  18. rem Forground values. Set f to one of these for normal intensity:
  19. rem 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=gray
  20. rem High intensity forground colors: Precede the number above with "1;"
  21. rem ---------------------------------------------------------------------
  22. if x%color%==xbw goto bw
  23. if x%color%==xYb goto Yb
  24. if x%color%==xbc goto bc
  25. rem The color will be set but prompt will not be set.
  26. goto doit
  27. rem --------------------------------------------------------------------
  28. rem Settings for each color combination you want to use.
  29. :bc
  30. rem blue on cyan. Was f=34 b=36. Got cyan on black
  31. set f=34
  32. set b=46
  33. goto doit
  34. :bw
  35. rem blue on white.
  36. set f=34
  37. set b=47
  38. goto doit
  39. :Yb
  40. rem Yellow on blue.
  41. set f=1;33
  42. set b=44
  43. goto doit
  44. :doit
  45. rem Put ANSI sequence in prompt
  46. prompt $e[0;%f%;%b%m$p]
  47. set f=
  48. set b=
  49. color %color% & cls
  50. :end
  51.