advr.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
WIDTH Statement Details
  ◄Summary►  ◄Details►  ◄Example►                ◄Contents►  ◄Index►  ◄Back►
──────────────────────────────────────────────────────────────────────────────
 WIDTH {#filenumber% | device$}, width%
 WIDTH LPRINT width%
 WIDTH {screenwidth% | ,screenheight% | screenwidth%, screenheight%}
 
 Usage Notes
   ■ Any reference to WIDTH device$ where device$ represents SCRN: or CONS:
     is not allowed with forms and causes Visual Basic to generate the error
     message, "Invalid when forms are showing."
 
   ■ To use the WIDTH statement with forms, you must first unload or hide any
     visible forms. See: ◄HIDE Method►  ◄UNLOAD Statement►
 
   ■ WIDTH #filenumber%, width%
     • Sets the line width of an output device already opened as a file -
       for example, LPT1: or CONS:.
     • The argument filenumber% is the file number associated with the device
       through the OPEN statement.
     • The "#" character in front of filenumber% is not optional.
     • The width assignment takes place immediately.
 
   ■ WIDTH device$, width%
     • Sets to width% the line width of device$ (a device file name). The
       device should be a string expression - for example, "LPT1:".
     • The width assignment is deferred until the next OPEN statement
       affecting the device.
     • The assignment does not affect output for an already open device.
 
   ■ WIDTH LPRINT width%
     • Sets the line width of the line printer for use by subsequent LPRINT
       statements.
     • Equivalent to the statement:
 
              WIDTH "LPT1:", width
 
   ■ WIDTH {screenwidth% | ,screenheight% | screenwidth%, screenheight%}
     • Sets the number of text character columns and lines to display on the
       screen.
     • The value of screenwidth% must be either 40 or 80; default is 80.
     • The value of screenheight% may be 25, 30, 43, 50, or 60, depending on
       the display adapter used and the screen mode.
     • The number of lines that can be displayed when the program is started
       is listed below:
 
                  Screen
     Adapter(1)   Mode(2)  Screenwidth x Screenheight  Color Display
     ═══════════  ═══════  ══════════════════════════  ═════════════════════
     MDPA         0        80x25                       Monochrome
     Hercules     0        80x25                       Monochrome
                  3        80x25                       Monochrome
     CGA          0        40x25, 80x25                Color
                  1        40x25                       Color
                  2        80x25                       Color
     EGA          0        40x25, 40x43, 80x25, 80x43  Color
                  0        40x25, 40x43, 80x25, 80x43  Enhanced color
                  0        40x25, 40x43, 80x25, 80x43  Monochrome
                  1        40x25                       Color or Enhanced
                  2        80x25                       Color or Enhanced
                  7        40x25                       Color or Enhanced
                  8        80x25                       Color or Enhanced
     EGA          9        80x25, 80x43                Enhanced color
     EGA or VGA   10       80x25, 80x43                Monochrome
     VGA          0        40x25, 40x43, 40x50         Analog
                  0        80x25, 80x43, 80x50         Analog
                  1        40x25                       Analog
                  2        80x25                       Analog
                  7        40x25                       Analog
                  8        80x25                       Analog
                  9        80x25, 80x43                Analog
                  10       80x25, 80x43                Analog
                  11       80x30, 80x60                Analog
                  12       80x30, 80x60                Analog
                  13       40x25                       Analog
     MCGA         0        40x25, 80x25                Color or Analog
                  1        40x25                       Color or Analog
                  2        80x25                       Color or Analog
                  11       80x30, 80x60                Analog
                  13       40x25                       Analog
     ───────────────────────────────────────────────────────────────────────
     (1) See: ◄SCREEN Statement►
     (2) Screen mode 4 has a screen width and screen height of 80x25 in text
         format.