home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
busi
/
bordchek.zip
/
BORDCHEK.PF3
next >
Wrap
Text File
|
1990-03-05
|
3KB
|
69 lines
' BORDCHEK.PF3 3/5/90
' Authors: Richard Trump and David Topps
'
' This is a modified version of a project written by David Topps. I used
' a technique I had worked out several months ago to read the screen. This
' should work on both text and graphic screens. The screen reading is mine,
' the program structure and mode determination is David's. David's original
' comments are included here for background reference.
'
' Enjoy
'
'════════════════════════════ Dick Trump ══════════════════════════════
'
'
'This is to test whether there is a border on or not (23/2/90).
'(With thanks to Michael McDonnell for the inspiration.)
'The routine peeks at screen memory and checks the coordinates given in the
'arguments for brdrchk() to see if they are the double-line box characters.
'It has been tested with the initial full screen but there seems to be no
'reason why it would not work with a split screen. You should be able to
'check any screen coordinate and therefore any window.
'If you wish to also check another window apart from the current one, then
'you will also need to check for the single-line box characters.
'brdrchk() returns 0 if border is off; 2 if border on for current window
'and 1 if border is on for an inactive window
'════════════════════════════ Dave Topps ══════════════════════════════
PUBLIC brdrchk(2) $row $col $pnt_on
MAIN
SMARTPEEK $_paint $pnt_on
IF NOT( $pnt_on)
SCREEN PRINT SCRHEIGHT 1 FGPLEASING BGPLEASING FORMAT "M"|STR(SCRWIDTH)\
"REPAINT is OFF. brdrchk() may not work correctly"
WAIT 5
END IF
SCREEN SHORTINPUT $row "Enter row (1-" | STR(SCRHEIGHT-4)|")"
SCREEN SHORTINPUT $col "Enter col (1-"| STR(SCRWIDTH)| ")"
SCREEN PRINT SCRHEIGHT 1 FGPLEASING BGPLEASING FORMAT "M"|STR(SCRWIDTH)\
"BORDER IS "| CASE( brdrchk(VAL($row),VAL($col))) (2,"ON (active)")\
(1,"ON (inactive)")(0,"OFF") ELSE "Unknown"
WAIT 20
END MAIN
FUNCTION brdrchk( $row, $col)
LOCAL byte saveit vmode
screen save $row $col $row $col saveit
unpack saveit[11] "1S" byte
byte=asc(byte)
' Get video mode
SETREG(AX,0x0F00)
INTERRUPT 0x10
vmode = MOD( GETREG(AX), 256)
' Assume Smart will not be using modes 0 or 1 (40 column text).
IF vmode = 2 OR vmode = 3 or vmode = 7 ' text mode
RETURN ( CASE (byte) (186,2)(187,2)(188,2)(200,2)(201,2)(205,2)(179,1)\
(191,1)(192,1)(196,1)(217,1)(218,1) ELSE 0)
ELSE
RETURN ( CASE (byte) (15,2)(21,2)(28,2)(29,2)(30,2)(31,2)(1,1)\
(2,1)(5,1)(6,1)(7,1)(8,1) ELSE 0)
END IF
END FUNCTION