table check header

Prev Next

Function Names

table check header

Description

This function checks if a header with the specified header name is existing. If the header is found, then the column number will be returned. Otherwise, an exception will be asserted.

Call as: function

Restrictions

Indirect parameter passing is disabled

Parameter count

2

Parameters

No.TypeDescription
1
input
string Name of existing table

2
input
table column Header name or column number

See table columns as function parameters for general ruling for this parameter.
Specific rules apply for this function:

  • Only 1 header name or column number may be specified.

Return value

TypeDescription
numeral Column number

Note: 1st column begins with 0

Exceptions

Table not found
Header name not found

Examples

  table initialize ( table 1,
  { { Last Name, First Name, Phone No, Age }, { Larsson, Lara, "1-212-555-1212", 28 } } );

  echo( table check header ( table 1, Phone No ) );
//    echo( table check header ( table 1, Gender ) ); // Not executed now, would cause exception

Output

2
Try it yourself: Open LIB_Function_table_check_header.b4p in B4P_Examples.zip. Decompress before use.

See also

table column number
table check headers