  -27-


  CHAPTER 2 / CONVENTIONS


  This chapter contains information about three conventions that are
  used throughout 4DOS, 4OS2, and 4NT:  colors and color names, keys
  and key names, and popup windows.  These topics are combined here
  in a central reference spot so that they will be easy to find when
  you need to refer to them.  You will find cross references to this
  chapter in several other parts of this manual.


  Colors and Color Names

       You can use color names in several of the directives in the
       .INI file and in many commands.  The general form of a color
       name is:

            [BRIght] [BLInk] fg ON [BRIght] bg [BORder bc]

       where fg is the foreground or text color, bg is the
       background color, and bc is the border color.

       The available colors are:

            Black         Blue        Green          Red
            Magenta       Cyan        Yellow         White

       Color names and the words BRIght, BLInk, and BORder may be
       shortened to the first 3 letters.  BORder is valid only in
       4DOS and 4OS2.

       You can also specify colors by number instead of by name.
       The numbers are most useful in potentially long .INI file
       directives like ColorDir, where using color names may take
       too much space.  The following numbers are recognized:

                    0 - Black        8 - Gray (bright black)
                    1 - Blue         9 - Bright blue
                    2 - Green        10 - Bright green
                    3 - Cyan         11 - Bright cyan
                    4 - Red          12 - Bright red
                    5 - Magenta      13 - Bright magenta
                    6 - Yellow       14 - Bright yellow
                    7 - White        15 - Bright white

       Use one number to substitute for the [BRIght] fg portion of
       the color name, and a second to substitute for the [BRIght]
       bg portion.  For example, instead of bright cyan on blue you
       could use 11 on 1 to save space in a ColorDir specification.

       There are several subtleties that complicate the use of
       colors and color names.  In order to understand them, you
       will need to read through the restrictions described below.
       You may also want to review the Video section in the previous
       chapter (see page 24).  These restrictions are due to the
       design of your PC video hardware, BIOS, and video drivers,
  -28-

       and are not inherent in 4DOS, 4OS2, or 4NT.  Some of the
       restrictions are complex, so feel free to skip over those
       that do not apply to color combinations you use.

       Some restrictions depend on the display "mode."  4DOS, 4OS2,
       and 4NT can run in either full-screen display mode, when the
       command processor is using the entire screen and has more
       direct control over the video hardware; or in windowed
       display mode, when the command processor appears in a window
       as part of a graphical display under OS/2, Windows 3.x,
       Windows 95, or Windows NT.


       Color Errors

       A standard color specification allows sixteen foreground and
       eight background colors (sixteen if bright backgrounds are
       enabled, see below).  However, most video adapters and
       monitors do not provide true renditions of certain colors.
       For example, most users see normal "yellow" as brown, and
       bright yellow as yellow; many also see normal red as red, and
       "bright red" as pink.  Color errors are often much worse when
       running in windowed mode (see above), because the graphical
       environment that created the window may not map the text-mode
       colors the way you expect.  These problems are inherent in
       the monitor, video adapter, and driver software.  They cannot
       be corrected using 4DOS, 4OS2, or 4NT color specifications.


       Border Colors

       In order to use border colors, you must have a color video
       adapter (monochrome adapters do not support border colors).

4NT    4NT does not support border colors, and will ignore the
       BORder keyword.

4DOS,  4DOS and 4OS2 can only accept border colors in the CLS and
4OS2   COLOR commands, and in the StdColors directive in the .INI
       file.  Border colors will be ignored, or will cause an error,
       if they are used elsewhere.

       Border colors do not work in windowed mode, and will be
       ignored if used in a windowed session under Windows 3.x,
       Windows 95, or OS/2.


       Blinking Text and Bright Background Colors

       The interactions between blinking characters, bright
       backgrounds, and your display mode can be complex.  You will
       need to understand them if you use either attribute in your
       color specifications.

       The effects of blinking and bright background color
       specifications depend partly on whether you are in full-
       screen or windowed display mode.
  -29-

       Full-Screen Display Mode

       Full-screen display mode uses the entire screen for your
       command processor or application.  This mode is the only one
       available in DOS; it is available as an option for text-mode
       sessions in Windows and OS/2.

       In full-screen display mode your video hardware can be
       configured via software commands to display either blinking
       text, or text with a bright background, but not both.  This
       is due to the design of PC video hardware, and is not a
       software restriction.

       The memory on your video adapter includes a "flag" for each
       character on the screen.  The flag controls blinking text and
       bright background colors.  If the flag is off, the character
       is displayed with a normal background and does not blink.  If
       the flag is "on," the character either blinks or is displayed
       with a bright background, depending on which way your video
       adapter is currently configured.

4DOS,  In full-screen display mode, the configuration of your video
4OS2   adapter can be controlled by 4DOS and 4OS2 with the BrightBG
       directive in the 4DOS.INI file (see page 159) or the SETDOS
       /B command (page 364).  If you set BrightBG = No or use the
       SETDOS /B0 command, 4DOS and 4OS2 will configure the video
       adapter for blinking text, and all characters on the screen
       with the blink / bright background flag set will blink.  If
       you set BrightBG = Yes or use SETDOS /B1, 4DOS and 4OS2 will
       configure the video adapter for bright background colors, and
       the characters will be displayed with a bright background
       instead of blinking.

4NT    BrightBG and SETDOS /B are not available under 4NT, because
       Windows NT always enables bright backgrounds and disables
       blinking text.

       Because there is only one flag for each character to specify
       both blinking text and bright background color, it doesn't
       matter which attribute you use when you specify the color.
       Whether you specify blinking text or a bright background, you
       will see the same thing on your screen.  For example, these
       two COLOR commands will always produce the same results:

            color blink white on blue
            color white on bright blue

       If bright backgrounds are enabled, both commands will produce
       white text on a bright blue background.  If blinking text is
       enabled, both commands will produce blinking white text on a
       blue background.

       If you don't use BrightBG or SETDOS /B, or you explicitly use
       a SETDOS /B2, 4DOS and 4OS2 will not attempt to configure
       your video hardware.  Most video adapters default to blinking
       text in full-screen mode, but this can be changed by
       application programs.  If you use BrightBG, or SETDOS /B0 or
  -30-

       /B1, 4DOS and 4OS2 will configure the hardware each time they
       display the prompt.


       Windowed Display Mode

       Windowed display mode uses a window on the screen for your
       command processor or text-mode application.  It is available
       for command processor sessions and most applications running
       under Windows or OS/2.

       In windowed mode, the command processor cannot control your
       hardware to select blinking or bright backgrounds.  Instead,
       Windows 3, Windows 95, Windows NT, and OS/2 all display
       bright background colors, regardless of the BrightBG or
       SETDOS /B setting.  They do not provide a way to display
       blinking characters in windowed mode.  As an example, the two
       commands given above would both display white text on a
       bright blue background when run in windowed mode.


       Switching Modes

       Windows 3, Windows 95, and OS/2 allow you to switch any DOS
       or other text-mode session between full-screen and windowed
       mode; Windows NT allows you to switch modes for any console
       (non-graphical) session.  For example, when running 4DOS in a
       DOS session under Windows, you can switch modes by pressing
       Alt-Enter.  Switching modes will usually alter color
       rendition, as you switch between direct interaction with the
       video board (in full-screen mode) and the color mapping
       provided by your graphical environment (in windowed mode).
       In addition, switching modes may alter the display of
       blinking text and bright background characters as described
       above.

4DOS   Under 4DOS, if BrightBG is set to Yes, bright background
       colors will be preserved when you switch modes.  However, if
       BrightBG is set to No, the display will shift from blinking
       text in the full-screen mode to bright background colors
       behind that text in the windowed mode.  This effect can be
       disturbing; you may need to take it into account if you write
       batch files or aliases which may be used in either mode.

4OS2   You cannot switch modes for OS/2 sessions, so 4OS2 is not
       directly affected by mode switching.  However, if you write
       batch files or aliases which run in both modes, you may need
       to take into account that OS/2 defaults to displaying
       blinking text in full-screen mode and bright backgrounds in
       windowed mode.


  Keys and Key Names

       Key names are used to define keystroke aliases, in several of
       the .INI file directives, and with the 4DOS and 4OS2 KEYSTACK
  -31-

       command.  The format of a key name is the same in all three
       uses:

            [Prefix-]Keyname

       The key prefix can be left out, or it can be any one of the
       following:

            Alt     followed by A - Z, 0 - 9, F1 - F12, or Bksp
            Ctrl    followed by A - Z, F1 - F12, Tab, Bksp, Enter,
                    Left, Right, Home, End, PgUp, PgDn, Ins, or Del
            Shift   followed by F1 - F12 or Tab.

       The possible key names are:

            A - Z         Enter       PgDn
            0 - 9         Up          Home
            F1 - F12      Down        End
            Esc           Left        Ins
            Bksp          Right       Del
            Tab           PgUp

       All key names must be spelled as shown.  Alphabetic keys can
       be specified in upper or lower case.  You cannot specify a
       punctuation key.

       The prefix and key name must be separated by a dash [-].  For
       example:

            Alt-F10        This is okay
            Alt F10        The space will cause an error

       If you prefer, you can use a numeric value instead of a key
       name.  Use the ASCII code for an ASCII, extended ASCII, or
       control character.  Use the scan code preceded by an at sign
       [@] for extended key codes like F1 or the cursor keys.  For
       example, use 13 for Enter, or @59 for F1.  In general, you
       will find it easier to use the names described above rather
       than key numbers.  See the online help for an explanation and
       list of ASCII and key codes.

       Some keys are intercepted by your operating system or BIOS
       and are not passed on to 4DOS, 4OS2, or 4NT.  For example,
       under DOS Ctrl-S pauses screen output temporarily, and on
       some systems Ctrl-P toggles Print Echo mode (where text
       displayed on the screen is automatically echoed to the
       printer).  Keys which are intercepted by the operating system
       or BIOS generally cannot be assigned to aliases or with key
       mapping directives, because the command processor never
       receives these keystrokes and therefore cannot act on them.

       You also may not be able to use certain keys if your keyboard
       is not 100% IBM-compatible, your keyboard driver does not
       support them, or, under DOS, if you have an ANSI driver which
       does not support them.  For example, on some systems the F11
       and F12 keys are not recognized; others may not support
       unusual combinations like Ctrl-Tab.  These problems are rare;
  -32-

       when they do occur, they are usually due to the operating
       system and/or your ANSI driver.


  Popup Windows

       Several features of 4DOS, 4OS2, and 4NT display popup
       windows.  A popup window may be used to display filenames,
       recently-executed commands, recently-used directories, the
       results of an extended directory search, or a list created by
       the SELECT command or the @SELECT internal function.

       Popup windows always display a list of choices and a cursor
       bar.  You can move the cursor bar inside the window until you
       find the choice that you wish to make, then press the Enter
       key to select that item.

       Navigation inside any popup window follows the conventions
       described below.  Additional information on each specific
       type of popup window is provided when that window is
       introduced, later in the manual.

       You can control the color, position and size of most popup
       windows from the Command Line 2 page of the OPTION dialogs.
       You can also control these features with directives in the
       .INI file, including PopupWinLeft, PopupWinTop,
       PopupWinWidth, and PopupWinHeight (see page 158), and
       PopupWinColors (see page 160).  A few popup windows (e.g.,
       the extended directory search window) have their own specific
       .INI directives, and corresponding separate choices in the
       OPTION command.  You can also change the keys used in most
       popup windows with key mapping directives in the .INI file
       (see page 164).

       Once a window is open, you can use these navigation keys to
       find the selection you wish to make:

            Up Arrow            Move the selection bar up one line.
            Down Arrow          Move the selection bar down one
                                line.
            Left Arrow          Scroll the display left 4 columns.
            Right Arrow         Scroll the display right 4 columns.
            PgUp                Scroll the display up one page.
            PgDn                Scroll the display down one page.
            Ctrl-PgUp or Home   Go to the beginning of the list.
            Ctrl-PgDn or End    Go to the end of the list.
            Esc                 Close the window without making a
                                selection.
            Enter               Select the current item and close
                                the window.

       In addition to scrolling through a popup window, you can
       search the list using character matching.  If you press a
       character, the cursor bar will move to the next entry that
       begins with that character.  If you type multiple characters,
       the cursor will move to the entry that begins with the search
       string entered to that point (you can enter a search string
  -33-

       up to 32 characters long).  If no entry matches the character
       or string that you have typed, the command processor beeps
       and does not move the cursor bar.  To reset the search
       string, press Backspace.

       You can change the keys used in popup windows with key
       mapping directives in the .INI file (see page 161).
