Next, you need to know how to identify the columns in the Order browse. The browse is a single ABL object with its own handle, but the columns in the browse have handles as well. The browse acts as a container for those columns much as a frame does for the fields and other objects it contains.

To get the handle to the first column in a browse, you use its FIRST-COLUMN attribute. The chain of columns is linked by the NEXT-COLUMN attribute of each column.

This next block of code for changeFields checks to see if the current object in the frame is a browse. If it is, then it moves the browse to the left by changing its COLUMN attribute, and widens it by six characters by setting the WIDTH-CHARS attribute. It then walks through the columns, checking each one’s data type. If a column is a date, it widens it by four characters. You use the same DO WHILE VALID-HANDLE block header as for the frame itself to walk through all the columns in the browse:


  ELSE IF hObject:TYPE = "Browse" THEN
    DO:
      ASSIGN hObject:COLUMN = hObject:COLUMN - 3
        hObject:WIDTH-CHARS = hObject:WIDTH-CHARS + 6.
      hColumn = hObject:FIRST-COLUMN.
      DO WHILE VALID-HANDLE(hColumn):
        IF hColumn:DATA-TYPE = "DATE" THEN
          hColumn:WIDTH-CHARS = hColumn:WIDTH-CHARS + 4.
        hColumn = hColumn:NEXT-COLUMN.
      END.
    END.

Finally, you need to remember to move on to the next object in the frame before ending the original DO block:

  hObject = hObject:NEXT-SIBLING. 
END.
END PROCEDURE.

The following figure shows what you see when you run the window.

Figure 1. Updated sample window