home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / busi / bordchek.zip / BORDCHEK.PF3 next >
Text File  |  1990-03-05  |  3KB  |  69 lines

  1. ' BORDCHEK.PF3      3/5/90
  2. ' Authors: Richard Trump and David Topps
  3. '
  4. ' This is a modified version of a project written by David Topps.  I used
  5. ' a technique I had worked out several months ago to read the screen.  This
  6. ' should work on both text and graphic screens.  The screen reading is mine,
  7. ' the program structure and mode determination is David's.  David's original
  8. ' comments are included here for background reference.
  9. '
  10. ' Enjoy
  11. '
  12. '════════════════════════════ Dick Trump ══════════════════════════════
  13. '
  14. '
  15. 'This is to test whether there is a border on or not (23/2/90).
  16. '(With thanks to Michael McDonnell for the inspiration.)
  17. 'The routine peeks at screen memory and checks the coordinates given in the
  18. 'arguments for brdrchk() to see if they are the double-line box characters.
  19. 'It has been tested with the initial full screen but there seems to be no
  20. 'reason why it would not work with a split screen. You should be able to
  21. 'check any screen coordinate and therefore any window.
  22. 'If you wish to also check another window apart from the current one, then
  23. 'you will also need to check for the single-line box characters.
  24. 'brdrchk() returns 0 if border is off; 2 if border on for current window
  25. 'and 1 if border is on for an inactive window
  26. '════════════════════════════ Dave Topps ══════════════════════════════
  27.  
  28. PUBLIC  brdrchk(2) $row $col $pnt_on
  29.  
  30. MAIN
  31. SMARTPEEK $_paint $pnt_on
  32. IF NOT( $pnt_on)
  33.         SCREEN PRINT SCRHEIGHT 1 FGPLEASING BGPLEASING FORMAT "M"|STR(SCRWIDTH)\
  34.          "REPAINT is OFF. brdrchk() may not work correctly"
  35.         WAIT 5
  36. END IF
  37. SCREEN SHORTINPUT $row "Enter row (1-" | STR(SCRHEIGHT-4)|")"
  38. SCREEN SHORTINPUT $col "Enter col (1-"| STR(SCRWIDTH)| ")"
  39. SCREEN PRINT SCRHEIGHT 1 FGPLEASING BGPLEASING FORMAT "M"|STR(SCRWIDTH)\
  40.  "BORDER IS "| CASE( brdrchk(VAL($row),VAL($col))) (2,"ON (active)")\
  41.  (1,"ON (inactive)")(0,"OFF") ELSE "Unknown"
  42. WAIT 20
  43. END MAIN
  44.  
  45.  
  46. FUNCTION brdrchk( $row, $col)
  47. LOCAL byte saveit vmode
  48.  
  49. screen save $row $col $row $col saveit
  50. unpack saveit[11] "1S" byte
  51. byte=asc(byte)
  52.  
  53. ' Get video mode
  54. SETREG(AX,0x0F00)
  55. INTERRUPT 0x10
  56. vmode = MOD( GETREG(AX), 256)
  57. ' Assume Smart will not be using modes 0 or 1 (40 column text).
  58. IF vmode = 2 OR vmode = 3 or vmode = 7       ' text mode
  59.    RETURN ( CASE (byte) (186,2)(187,2)(188,2)(200,2)(201,2)(205,2)(179,1)\
  60.       (191,1)(192,1)(196,1)(217,1)(218,1) ELSE 0)
  61. ELSE
  62.    RETURN ( CASE (byte) (15,2)(21,2)(28,2)(29,2)(30,2)(31,2)(1,1)\
  63.       (2,1)(5,1)(6,1)(7,1)(8,1) ELSE 0)
  64. END IF
  65.  
  66. END FUNCTION
  67.  
  68.  
  69.