ScanMode is a program developed by Keld "HeartWare" Hansen. It scans through all modes on a VGA card and notes which modes are text modes and what their resolution is. It then saves this information in a file of the following format (PASCAL notation used): RECORD Version : BYTE { Must be 6 } Modes : ARRAY[1..n] OF RECORD ModeNo : BYTE; Width : BYTE; Height : BYTE; CharWidth : BYTE; ScanLines : WORD END END The CharWidth and ScanLines are set to zero by ScanMode and are only present in the file for future use. To point to the file, a standard is enforced: The environment variable MODEINFO is used to point to the file. If the value of MODEINFO is a directory, then the file is called MODEINFO.DAT in that directory. If the value of MODEINFO is a file without a file type, then .DAT is assumed. If the value of MODEINFO points to an existing file, then that's it! To switch into a specific text resolution, read the file, comparing the requested screen width and height to the values found in the record. When a match is found, you can switch into the mode specified by ModeNo and voil…, you are in a text mode with that resolution. Please note, that Borland/Turbo Pascal doesn't recognize these extended text modes, and that if a person starts up a pascal program while being in one of these modes, then the initialization code in the CRT unit switches back into 80x25 (mode 3 or 7). Also note, that WRITE and WRITELN probably don't work in the extended text modes. You will need to do your own screen handling. You are hereby granted an unlimited license to distribute this archive with your Public Domain programs and the format of the file is released as Public Domain as well.