Accessing Tables

Prev Next

Introduction

B4P provides the following four table access methods to access table contents:

  • Simple table access to access individual table cells
  • Horizontal table access to access multiple cells in a specified row:
    • a selection of different columns,
    • a range containing mulitiple consecutive columns, and
    • all cells in the entire row.
  • Vertical table access to access multiple cells in a specified column:
    • a selection of different rows,
    • a range containing mulitiple consecutive rows, and
    • all cells in the entire column.
  • Matrix table access is the combination of the both:
    • a selection of different cells over the table
    • a range containing multiple rows and columns
    • all cells in the entire table.

In addition to these basic acces modes, transactions and various functions do also provide powerful means to access the tables.

Reading Contents

Data can only read from tables if they are existing or initialized.

By default, following read access rules apply:

  • Numeric contents (excl. scientific notation) will be read as numerals
  • Text contents (incl. blanks) will be read as strings
  • Dates, 'true', 'false', etc. will also be read as string.

However, the function table configure() lets you decide whether to read dates, booleans, etc. as dates and not as strings. Oppositely, this function can also force reading numbers as strings.

Attempting to read values which lie outside the table (except if referencing above the header row or left of the first column) will return blanks (empty strings).

Writing Contents

Data can only written to tables if the tables are existing or initialized.

All data written to tables will be converted to strings first. This also includes for numbers, dates, times, parameter sets, etc. For boolean values, the text values 'true' and 'false' will be used. If you want to read the text values 'true' and 'false' as booleans, the use table configure() to activate this: table configure(table name, read booleans, yes );

Attempting to write values which lie outside the table (except if referencing above the header row or left of the first column) will work successfully. If necessary, the size of the table will be extended accordingly. Valid example: [ table: 999, 999] = "nine nine nine";

Advanced Features

Following features are supported to facilitate accessing table contents: