home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / l / l196 / 3.ddi / ADAPTER.BA$ / ADAPTER.bin
Encoding:
Text File  |  1990-06-24  |  1.4 KB  |  67 lines

  1. DECLARE SUB Adapter ()
  2. DEFINT A-Z
  3.  
  4. Adapter
  5.  
  6. SUB Adapter
  7. ON LOCAL ERROR GOTO Handler
  8. CONST False = 0, True = NOT False
  9. ' Use an array to keep track of our test results
  10. DIM Mode(1 TO 13)
  11.  
  12. ' Try screen modes and see which work.
  13. FOR ModeNumber = 1 TO 13
  14.     ' Assume the test works unless you get an error.
  15.     Mode(ModeNumber) = True
  16.     SCREEN ModeNumber
  17. NEXT ModeNumber
  18.  
  19. ' Reset the screen after testing it.
  20. SCREEN 0, 0
  21. WIDTH 80
  22.  
  23. ' Using test results figure out which adapter is out there.
  24. ' Tell operator which one he has.
  25. ' (See tables in SCREEN section of BASIC Language Reference
  26. ' to undertand why this logic works.)
  27. PRINT "You have a ";
  28. IF Mode(13) THEN
  29.     IF Mode(7) THEN
  30.         PRINT "VGA";
  31.         UseableModes$ = "0-2, 7-13."
  32.     ELSE
  33.         PRINT "MCGA";
  34.         UseableModes$ = "0-2, 11 and 13."
  35.     END IF
  36. ELSE
  37.     IF Mode(7) THEN
  38.         PRINT "EGA";
  39.         UseableModes$ = "0-2, 7-10."
  40.     ELSE
  41.         IF Mode(3) THEN
  42.             PRINT "Hercules";
  43.             UseableModes$ = "3."
  44.         END IF
  45.         IF Mode(4) THEN
  46.             PRINT "Olivetti";
  47.             UseableModes$ = "4."
  48.         END IF
  49.         IF Mode(1) THEN
  50.             PRINT "CGA";
  51.             UseableModes$ = "0-2."
  52.         ELSE
  53.             PRINT "MDPA";
  54.             UseableMode$ = "0."
  55.         END IF
  56.     END IF
  57. END IF
  58. PRINT " Graphics card that supports screen mode(s) "; UseableModes$
  59. EXIT SUB
  60.  
  61. ' Branch here when test fails and change text result.
  62. Handler:
  63.     Mode(ModeNumber) = False
  64.     RESUME NEXT
  65. END SUB
  66.  
  67.