Provides display and editing of records in a table format.

Syntax

BROWSE
[COLOR <color>]
[FIELDS <field 1> [<field option list 1>] |
 <calculated field 1> = <exp 1> [<calculated field option list 1>]
 [, <field 2> [<field option list 2>] |
 <calculated field 2> = <exp 2> [<calculated field option list 2>]...]]
[FREEZE <field 3>]
[LOCK <expN 1>]
[NOAPPEND]
[NOEDIT | NOMODIFY]

COLOR <color>

Specifies the color of the cells in the BROWSE. The current highlighted cell has its own, fixed color. The <color> is made up of a foreground color and a background color, separated by a forward slash (/). You may use a Windows-named color, one of the basic 16-color color codes, or a user-defined color name. For more information on colors, see colorNormal.

FIELDS <field 1> [<field option list 1>] |
<calculated field 1> = <exp 1> [<calculated field option list 1>]
[, <field 2> [<field option list 2>] |
<calculated field 2> = <exp 2> [<calculated field option list 2>] ... ] ]

Displays the specified fields, in the order they're listed, in the Table window. Options for <field option list 1>, <field option list 2>, which apply to <field 1>, <field 2>, and so on, affect the way these fields are displayed. These options are as follows:

Option

Description

\<column width>

The width of the column within which <field 1> appears when <field 1> is character type

\B = <exp 1>, <exp 2>

RANGE option; forces any value entered in <field 1> to fall within <exp 1> and <exp 2>, inclusive.

\C =<color>

COLOR option; sets the foreground and/or background colors of the column according to the values specified in <color>

\H = <expC>

HEADER option; causes <expC> to appear above the field column in the Table window, replacing the field name

\P = <expC>

PICTURE option; displays <field 1> according to the PICTURE or FUNCTION clause <expC>

\V = <condition>
[\E = <expC>]

VALID option; allows a new <field 1> value to be entered only when <condition> evaluates to true

ERROR MESSAGE option; \E = <expC> causes <expC> to appear when <condition> evaluates to false

Note

You may also use the forward slash (/) instead of the backslash (\) when specifying only a single option in a field option list.

Read-only calculated fields are composed of an assigned field name and an expression that results in the calculated field value, for example:

browse fields commission = RATE * SALEPRICE

Options for calculated fields affect the way these fields are displayed. These options are as follows:

Option

Description

\<column width>

The width of the column within which <calculated field 1> is displayed

\H = <expC>

Causes <expC> to appear above the calculated field column in the Table window, replacing the calculated field name

FREEZE <field 3>

Restricts editing to <field 3>, although other fields are visible.

LOCK <expN 2>

Keeps the first <expN 2> fields in place onscreen as you move the cursor to fields on the right.

NOAPPEND

Prevents records from being added when you cursor down past the last record in the Table window. The NOAPPEND option works in dBASE versions up to, and including, 5.7. It has no affect in dBASE versions higher than 5.7, or in dBASE Plus.

NOEDIT | NOMODIFY

Prevents you from modifying records from the Table window. The NOEDIT | NOMODIFY option works in dBASE versions up to, and including, 5.7. It has no affect in dBASE versions higher than 5.7, or in dBASE Plus.

Description

The BROWSE command opens a table grid in a window, displaying the fields in the currently selected work area. It is intended more for interactive use; in an application, you have more control over a Browse or Grid object in a form.

The BROWSE command is modeless. After the window is opened, the next statement is executed.

OODML

Use a Grid control on a form.