home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a046 / 5.img / TEMPLATE / GENHUE.INC < prev    next >
Encoding:
Text File  |  1992-04-01  |  1.1 KB  |  59 lines

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