The most complex graphical object is the browse object. You can create a browse dynamically and specify programmatically all its attributes, including what table and query’s records are displayed, what columns it displays, which columns are enabled for input, and its visible attributes such as size and position.

You can assign most of a dynamic browse’s attributes in the CREATE BROWSE statement:

CREATE BROWSE browse-handle ASSIGN attribute = value . . .

In addition, you can specify some attribute values individually following the CREATE statement:

browse-handle:attribute = value

Here are some of the principal attributes you can set either in the CREATE BROWSE statement or in a separate assignment on the browse handle:

  • FRAME — You must associate the browse with a frame it is visualized in.
  • X and Y, or ROW and COLUMN — You should specify a position for the browse. Otherwise, it is positioned in the upper-left corner of the frame. As for other objects, X and Y are in pixels, ROW and COLUMN are in character rows.
  • WIDTH or WIDTH-PIXELS — You should specify a width for the browse using the WIDTH attribute in characters or the WIDTH-PIXELS attribute in pixels.
  • HEIGHT, HEIGHT-PIXELS or DOWN — You should specify a height for the browse using either the character HEIGHT or HEIGHT-PIXELS attribute or the DOWN attribute. DOWN specifies the number of rows to display. Keep in mind that if you use the HEIGHT or HEIGHT-PIXELS attribute, then any horizontal scrollbar uses part of that height. The overall height of the browse remains the same whether there is a horizontal scrollbar or not. If you specify DOWN, that determines the number of rows of data to display, and any horizontal scrollbar is added to that height.
  • ROW-HEIGHT — Set this decimal attribute if you want each row to be different from the default, which is calculated based on the font.
  • SENSITIVE — You should generally make a browse sensitive so that the user can use the scroll bar.
  • QUERY — You must provide the browse with the handle of a query that provides its data to display.
  • VISIBLE or HIDDEN — You must set either HIDDEN to false, if you want the browse to be viewed when its parent frame if viewed, or VISIBLE to true to force the frame and the browse to be viewed.
  • READ-ONLY — Set this option to true if you are not going to enable columns in the browse.
  • SEPARATORS — Set this option to true if you want lines between the columns and rows of the browse.
  • ROW-MARKERS — Set this option to false if you do not want row markers at the beginning of each row.
  • NO-VALIDATE — Set this option to true to prevent ABL from compiling field-level validation phrases from the schema into the browse.
  • TITLE — Set this string if you want the browse to have a title bar.
  • MULTIPLE — Set this option to true if you want to enable multiple selection of rows.

Some attributes can only be assigned before the browse is realized. In the case of a dynamic browse, this is generally when the browse is made visible, which you can do in one of two ways:

  • By setting its VISIBLE attribute to true, which forces its containing frame to be viewed
  • By setting its HIDDEN attribute to false, which views the browse when its parent frame is viewed

In a CREATE BROWSE statement, the attributes of the browse in the ASSIGN list are assigned in sequence. So, as this single statement is executed, if the AVM encounters the VISIBLE = TRUE or HIDDEN = FALSE phrases (and its parent frame is visible), the browse is realized at that time. If you try to assign an attribute later in the statement, or in a separate statement, which has to be assigned before the browse is realized, you get an error at run time. For example, if you do not want the browse to have row markers at the beginning of each row, you set the ROW-MARKERS attribute to FALSE. If you put this assignment into the CREATE statement after an attribute that realizes the browse, you get the error shown:

If this occurs, you have to reorder the assignments in the CREATE BROWSE statement. Generally, you should put the assignment that realizes the browse at the end of the statement or in a separate attribute assignment statement.

In the same way, you can modify most attributes in separate statements after the browse has been realized, except for attributes such as ROW-MARKERS.