home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a075 / 1.img / TOOLKIT1.EXE / SST238.PRG < prev    next >
Encoding:
Text File  |  1989-08-08  |  3.6 KB  |  131 lines

  1. *********************
  2.  
  3. FUNCTION Whatcolor
  4.  
  5.    PARAMETERS _thecolor
  6.  
  7.    IF EMPTY(PCOUNT())
  8.       RETURN(SETCOLOR())
  9.    ELSE
  10.       IF TYPE("_thecolor")$"DL"
  11.          RETURN(SETCOLOR())
  12.       ENDIF
  13.    ENDIF
  14.  
  15.    PRIVATE _thereturn, _blink, _bright
  16.  
  17.    _bright = .F.
  18.    _blink = .F.
  19.  
  20.    IF TYPE("_thecolor") = "C"
  21.       _thecolor = UPPER(_thecolor)
  22.    ENDIF
  23.  
  24.    IF ISCOLOR() .AND. !(IF(TYPE("scrmono")="U", .T., scrmono))
  25.       IF TYPE("_thecolor") = "C"
  26.          _bright = ("+"$_thecolor)
  27.          _blink  = ("*"$_thecolor)
  28.          IF     "0" $ _thecolor
  29.             _thereturn = "N"
  30.          ELSEIF "1" $ _thecolor
  31.             _thereturn = "B"
  32.          ELSEIF "2" $ _thecolor
  33.             _thereturn = "G"
  34.          ELSEIF "3" $ _thecolor
  35.             _thereturn = "BG"
  36.          ELSEIF "4" $ _thecolor
  37.             _thereturn = "R"
  38.          ELSEIF "5" $ _thecolor
  39.             _thereturn = "RB"
  40.          ELSEIF "6" $ _thecolor
  41.             _thereturn = "GR"
  42.          ELSEIF "7" $ _thecolor
  43.             _thereturn = "W"
  44.          ELSEIF "8" $ _thecolor
  45.             _thereturn = "W+"
  46.          ELSEIF "9" $ _thecolor
  47.             _thereturn = "GR+"
  48.          ELSEIF "N" = _thecolor
  49.             _thereturn = "N"
  50.          ELSEIF "B" = _thecolor
  51.             _thereturn = "B"
  52.          ELSEIF "G" = _thecolor
  53.             _thereturn = "G"
  54.          ELSEIF "BG" = _thecolor
  55.             _thereturn = "BG"
  56.          ELSEIF "R" = _thecolor
  57.             _thereturn = "R"
  58.          ELSEIF "RB" = _thecolor
  59.             _thereturn = "RB"
  60.          ELSEIF "GR" = _thecolor
  61.             _thereturn = "GR"
  62.          ELSEIF "W" = _thecolor
  63.             _thereturn = "W"
  64.          ELSEIF "U" = _thecolor
  65.             _thereturn = "U"
  66.          ELSEIF "I" = _thecolor
  67.             _thereturn = "I"
  68.          ELSEIF "X" = _thecolor
  69.             _thereturn = "X"
  70.          ELSEIF "N+" = _thecolor
  71.             _thereturn = "N+"
  72.          ELSEIF "GR+" = _thecolor
  73.             _thereturn = "GR+"
  74.          ELSEIF _thecolor == "BOLD"
  75.             _thereturn = SETCOLOR()
  76.             _bright = .T.
  77.          ELSEIF _thecolor == "BLINK"
  78.             _thereturn = SETCOLOR()
  79.             _blink = .T.
  80.          ELSEIF _thecolor == "DULL"
  81.             _thereturn = STRTRAN(SETCOLOR(), "+", "")
  82.          ELSEIF _thecolor $ "RED"
  83.             _thereturn = "R"
  84.          ELSEIF _thecolor $ "GREEN"
  85.             _thereturn = "G"
  86.          ELSEIF _thecolor $ "CYAN"
  87.             _thereturn = "BG"
  88.          ELSEIF _thecolor $ "MAGENTA"
  89.             _thereturn = "RB"
  90.          ELSEIF _thecolor $ "BROWN"
  91.             _thereturn = "GR"
  92.          ELSEIF _thecolor $ "WHITE"
  93.             _thereturn = "W"
  94.          ELSEIF _thecolor $ "BLACK"
  95.             _thereturn = "N"
  96.          ELSEIF _thecolor $ "YELLOW"
  97.             _thereturn = "G+"
  98.          ELSEIF _thecolor $ "GREY"
  99.             _thereturn = "N+"
  100.          ELSEIF _thecolor $ "BLUE"
  101.             _thereturn = "B"
  102.          ELSE
  103.             _thereturn = _thecolor
  104.          ENDIF
  105.          IF "/"$_thereturn
  106.             IF _bright
  107.                _thereturn = STRTRAN(_thereturn, "/", "+/")
  108.             ENDIF
  109.             IF _blink
  110.                _thereturn = STRTRAN(_thereturn, "/", "*/")
  111.             ENDIF
  112.          ELSE
  113.             IF _bright
  114.                _thereturn = _thereturn + "+"
  115.             ENDIF
  116.             IF _blink
  117.                _thereturn = _thereturn + "*"
  118.             ENDIF
  119.          ENDIF
  120.          _thereturn = STRTRAN(_thereturn, "++", "+")
  121.       ELSE
  122.          _thereturn = TRIM(SUBSTR("R G BGRBGRW N B ", (_thecolor * 2) - 1, 2))
  123.       ENDIF
  124.    ELSE
  125.       _thereturn = "W"
  126.    ENDIF
  127.    RETURN(_thereturn)
  128.  
  129. * End of File
  130.  
  131.