Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

10.0;bl (balance) *DM*, revision 1.0, 88/03/09
bl (balance) - balance delimiters
usage: [range] bl [-i | -c] [l_char] [r_char]



DESCRIPTION
     bl determines whether a given pair of delimiting characters (for
     instance, left and right parentheses) is balanced within a specified
     range of text.

ARGUMENTS
     range (optional)
                  Specify a range of text to be checked. This argument is
                  valid only when used with -c; the range for -i is the
                  current cursor position to the end (or beginning) of the
                  file.  Define the range to be checked as described in help
                  DM range.

                  Default if omitted:  check from cursor to end of line.

     l_char (optional)
                  Specify the left delimiting character. If you specify r_char
                  but omit this argument, the left delimiting character
                  defaults to r_char. If you omit both arguments, the left
                  delimiting character defaults to left parenthesis.

     r_char (optional)
                  Specify the right delimiting character. If you specify
                  l_char but omit this argument, the right delimiting
                  character defaults to l_char. If you omit both arguments,
                  the right delimiting character defaults to right
                  parenthesis.

OPTIONS
     If you specify either of the following options, it must precede any
     arguments you specify.

     -i (default) Insert mode: search for balanced delimiters from the current
                  character to the beginning or end of the file.  The behavior
                  of bl depends upon the character under the cursor when you
                  invoke bl.

                  If you position the cursor on a delimiter and bl finds a
                  balancing delimiter, it moves the cursor to the matched
                  character momentarily (to show you where the balance is
                  completed), then returns the cursor to the character
                  immediately following the initial cursor postion. The search
                  direction is forward if the character under the cursor is a
                  left delimiter; backward if the character is a right
                  delimiter.

                  If you position the cursor on a delimiter and bl finds no
                  balancing delimiter, it gives an error message and sounds
                  the alarm, then inserts a matching right delimiter at the
                  initial cursor position.

                  If you position the cursor on a character other than a
                  delimiter, bl searches backward for the first occurrence of
                  l_char, briefly shows you where it is, then inserts a
                  matching right delimiter at the initial cursor position.

     -c           Check mode: check only; do not insert balancing characters
                  or move the cursor.  You can  mark a range of text to be
                  checked if you specify this option; see the range argument
                  above.  bl checks all pairs of specified delimiters within
                  the specified range and displays the results in the DM
                  message window.

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026