columns

Type: Integer

Availability: Read or write at run time only

The columns property contains the number of columns on the current sheet of a Table control.

Increasing columns adds empty columns to that existing sheet. Decreasing columns deletes excess columns, discarding any existing data in those columns.

Changing the columns property value to zero (0) empties the sheet of any data.

Changing the value of the columns property can affect the current values of the column, row, topRow, and leftColumn properties.

To delete a column, use the deleteColumn method.

You can assign a maximum of 16,000 columns to a Table control. However, depending on the number of rows that are also assigned to the table, the amount of memory required to handle a large number of columns limits the number of columns that can be handled, in practice.

The following examples show the use of the columns property.

load() updating;
begin
    table1.sheetCaption := "FirstTable";
    table1.columns      := 5;      // sets number of table columns
    table1.rows         := 20;
    table1.text         := 'A' & Tab & 'B' & Tab & 'C' & Tab & 'D' & Tab
                           & 'E' & Tab;
end;

selectDay(date: Date) updating;
vars
    r, c : Integer;
begin
    accessMode := 1;
    r := 2;
    while r <= rows do
        row := r;
        c := 1;
        while c <= columns do
            column := c;
            if text = date.day.String then
                foreColor := calendar.backColor;
                backColor := calendar.foreColor;
            else
                foreColor := calendar.foreColor;
                backColor := calendar.getSystemColor(Color_BtnFace);
            endif;
            c := c + 1;
        endwhile;
        r := r + 1;
    endwhile;
    row := 1;
    column := 1;
end;