home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a040 / 2.ddi / SHRWARE4.ARC / GENHUE.INC < prev    next >
Encoding:
Text File  |  1988-06-06  |  1.1 KB  |  58 lines

  1. <<* GENHUE.INC *>>
  2. <<#
  3.  
  4. function AtrCode( atr : integer ) : string
  5. string hilite,blink,hues,atrstrg
  6. integer hinib,lonib
  7. begin
  8.   hues := 'N ,B ,G ,BG,R ,BR,GR,W '
  9.   if (atr and 8) = 8
  10.     hilite := '+'
  11.   endif
  12.   if (atr and 128) = 128
  13.     blink := '*'
  14.   endif
  15.   lonib := (atr and 7)
  16.   hinib := ((atr shr 4) and 7)
  17.   atrstrg := rtrim( substr( hues,(lonib * 3) + 1,2 ) ) + blink + hilite + '/'
  18.   atrstrg := atrstrg + rtrim( substr( hues,(hinib * 3) + 1,2 ) )
  19.   RETURN atrstrg
  20. end <<*AtrCode*>>
  21.  
  22.  
  23. procedure GenColorAtr
  24. integer lastatr
  25. begin
  26.   if fldsay
  27.     lastatr := forecolor
  28.   else
  29.     lastatr := backcolor
  30.   endif
  31.   if (fldatr <> lastatr)
  32.     gen( 'SET COLOR TO ' )
  33.     if fldget
  34.       gen( ',' )
  35.     endif
  36.     genln( AtrCode(fldatr) )
  37.     if fldsay
  38.       forecolor := fldatr
  39.     else
  40.       backcolor := fldatr
  41.     endif
  42.   endif
  43. end <<*GenColorAtr*>>
  44.  
  45.  
  46. <<*
  47. procedure GenColorHue
  48. begin
  49.   if (fldhue <> lasthue)
  50.     genln( 'SET COLOR TO ',AtrCode( fldhue ) )
  51.     lasthue := fldhue
  52.   endif
  53. end GenColorHue
  54. *>>
  55.  
  56. <<* EOF: GENHUE.INC *>>
  57. #>>
  58.