' TEST-VID.BAS
' This program determines what screen modes your video adapter supports.

DIM okModes%(18)               ' array to hold video modes being tested

CLS

ON ERROR GOTO CannotSetMode:   ' tell the QBI what to do in case
                               '   it encounters an error

FOR i% = 0 TO 13               ' try to set the video adapter in
    SCREEN i%                  '   all 13 modes; if an error occurs
    IF errorCode% = 0 THEN     '   (meaning that mode isn't supported),
        okModes%(i%) = 1       '   then jump to the end of the program
        bestMode% = i%
    END IF
    errorCode% = 0
NEXT i%

SCREEN bestMode%               ' set best video mode for display

PRINT bestMode%
FOR i% = 0 TO 13
    IF okModes%(i%) = 1 THEN
        PRINT "You can use mode"; i%; "with your computer."
    END IF
NEXT i%

END

CannotSetMode:           ' "dummy" routine to handle error trapping
    errorCode% = 1       '   (to prevent the QuickBASIC Interpreter from
    RESUME NEXT          '   stopping and displaying and error message)
                     

