home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
windows
/
baswind8.zip
/
SETQUAD.SUB
< prev
next >
Wrap
Text File
|
1990-09-14
|
6KB
|
132 lines
'
'
'******************************************************************************
' Function : SETQUAD *
' *
' Purpose: *
' *
' *
' Results: *
' *
' Usage : *
' *
' *
' Date Written : 09/01/90 - Date Tested: 09/01/90 - Author: James P Morgan *
' Date Modified: - : - : *
'-----------------------------------------------------------------------------*
' NOTE: *
'******************************************************************************
' *
' SUB PROGRAM NAME (PARAMETERS) STATIC/RECURSIVE *
'-----------------------------------------------------------------------------*
' *
SUB SETQUAD(QUADRANT%,CROW%,CCOL%,MSGLEN%,MSGLINES%,RETURN.CODE%) STATIC
DEFINT A-Z 'make all short interger by default
RETURN.CODE%=0
SELECT CASE QUADRANT% 'set row and column co-ordinates
CASE 0 'based on the quadrant of the screen
GOSUB SETQUAD.QUAD0 'center
CASE 1
GOSUB SETQUAD.QUAD1 'upper left
CASE 2
GOSUB SETQUAD.QUAD2 'upper right
CASE 3
GOSUB SETQUAD.QUAD3 'lower right
CASE 4
GOSUB SETQUAD.QUAD4 'lower left
CASE ELSE 'invalid quadrant specified
CROW%=12 'default to center of screen
CCOL%=40
QUADRANT%=0 'let caller know we changed it
RETURN.CODE%=-2
END SELECT
EXIT SUB 'return to caller
'
SETQUAD.QUAD0:
CROW%=12 'center point based on 80 by 25 screen size
CCOL%=40 'center co-ordinate of screen
RETURN
SETQUAD.QUAD1:
CROW%=7 'center point for quadrant 1
CCOL%=20 'top left quadrant of screen
IF MSGLEN%\2<CCOL% THEN 'will the longest line be outside screen edge
GOTO SETQUAD.QUAD1.CONT
END IF
CCOL%=(MSGLEN%\2) 'quadrant 1 new center point
SETQUAD.QUAD1.CONT:
IF CROW%-(MSGLINES%\2)>=1 THEN 'will the window overflow botton of screen
RETURN
END IF
CROW%=1+(MSGLINES%\2) 'quadrant 2 new center point
RETURN
SETQUAD.QUAD2:
CROW%=7 'center point for quadrant 2
CCOL%=60 'top right quadrant of screen
IF (MSGLEN%\2)+CCOL%<80 THEN 'will the longest line be outside screen edge
GOTO SETQUAD.QUAD2.CONT
END IF
CCOL%=79-(MSGLEN%\2) 'quadrant 2 new center point
SETQUAD.QUAD2.CONT:
IF CROW%-(MSGLINES%\2)>=1 THEN 'will the window overflow botton of screen
RETURN
END IF
CROW%=1+(MSGLINES%\2) 'quadrant 2 new center point
RETURN
'
SETQUAD.QUAD3:
CROW%=18 'center point for quadrant 3
CCOL%=60 'bottom right quadrant of screen
IF (MSGLEN%\2)+CCOL%<80 THEN
GOTO SETQUAD.QUAD3.CONT 'will the longest line be outside screen edge
END IF
CCOL%=79-(MSGLEN%\2) 'quadrant 3 new center point
SETQUAD.QUAD3.CONT:
IF CROW%+(MSGLINES%\2)<=23 THEN 'will the window overflow botton of screen
RETURN
END IF
CROW%=23%-(MSGLINES%\2) 'quadrant 3 new center point
RETURN
SETQUAD.QUAD4:
CROW%=18 'center point for quadrant 4
CCOL%=20 'bottom left quadrant of screen
IF MSGLEN%\2<CCOL% THEN
GOTO SETQUAD.QUAD4.CONT 'will the longest line be outside screen edge
END IF
CCOL%=(MSGLEN%\2) 'quadrant 4 new center point
SETQUAD.QUAD4.CONT:
IF CROW%+(MSGLINES%\2)<=23 THEN 'will the window overflow botton of screen
RETURN
END IF
CROW%=23%-(MSGLINES%\2) 'quadrant 4 new center point
RETURN
END SUB