I previously posted this on another board (VBForums), but have not had any responses in 2 weeks. So now I've come to you!
I want to determine the maximum number of lines my display can have, so I wrote the following function:
Code: Select all
FUNCTION HighScreenRows
DIM ScreenMode(4)
'*** find maximum screen rows ***
ScreenMode(1) = 25: ScreenMode(2) = 43: ScreenMode(3) = 50: ScreenMode(4) = 60
FOR intRows = 1 TO 4
ResolutionGood = 1
ON ERROR GOTO ErrorHandler
WIDTH 80, ScreenMode(intRows)
ON ERROR GOTO 0
'
IF ResolutionGood = 1 THEN HighScreenRows = ScreenMode(intRows)
NEXT intRows
'
VIEW PRINT
EXIT FUNCTION
ErrorHandler:
'*** capture screenmode errors ***
ResolutionGood = 0
RESUME NEXT
END FUNCTION
So, what I'd like to know is a couple of things:
1. How do I properly handle my errors in subs/functions?
2. Is there a better way to determine the highest rows available?
I'm using QuickBasic 4.5, not QBasic.
Thanks, guys!