Tables - Naming Rules

Prev Next

Introduction

In B4P, referencing tables do always begin with the opening bracket [, typically followed by the table name, specifying the columns and finally the rows. The table reference will eventually end with ]. The different methods and formulations for Accessing tables are described in the next sections.

The top table row is row 0. Column counting also starts with 0.

Rules

  • All tables are identified with table names which are string values.
  • You can either use table names with or without quotation marks.
  • Similar to variable names, spaces are supported.
    • If no quotation marks are used, then multiple consecutive white spaces inside the name will be treated as 1 space.
    • If you need table names with multiple consecutive spaces, then put the name into quotation marks.
  • You can also specify an RHS Expression which returns a string containing the retrieved or calculated name
  • Names may begin or end with numbers, even with spaces inbetween, e.g. 4200 Pennsylvania Ave..
  • Blank table names are also allowed, e.g. ['':0,0], but not recommended if you want to keep code quality high.

       table load( table, "Examples\Cities.csv" );
       
       echo( [table: City, 2 ] );  // Retrieve row 2 from column 'City'
Washington
Try it yourself: Open LAN_Features_Table_names.b4p in B4P_Examples.zip. Decompress before use.