home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a013 / 1.ddi / SOURCE.EXE / F_SCRNAT.PRG < prev    next >
Encoding:
Text File  |  1991-01-25  |  870 b   |  31 lines

  1. *****************************************************************
  2. FUNCTION SCRNATTR  (top, left, bottom, right, new_attr)
  3. *****************************************************************
  4.  
  5. * Get or Set screen color attribute at specified coordinates
  6.  
  7. * Copyright(c) 1991 -- James Occhiogrosso
  8.  
  9. LOCAL counter, new_screen, old_attr, old_screen, scrn_len
  10.  
  11. new_screen = ''
  12. old_screen = SAVESCREEN(top, left, bottom, right)
  13. old_attr   = SUBSTR(old_screen, 2, 1)
  14. scrn_len   = LEN(old_screen)
  15.  
  16.  
  17. IF VALTYPE(new_attr) = 'N'
  18.    * If new attribute was passed, restore screen using it
  19.    FOR counter = 1 TO scrn_len STEP 2
  20.        new_screen = new_screen + SUBSTR(old_screen, counter, 1) ;
  21.                     + CHR(new_attr)
  22.    NEXT
  23.    RESTSCREEN(top, left, bottom, right, new_screen)
  24.  
  25. ENDIF
  26.  
  27. * Return original numeric attribute
  28. RETURN ASC(old_attr)
  29.  
  30.  
  31.