with table

Prev Next

Function Names

with table

Synopsis

with table ( table name, row number ) statement;
with table ( table name, row number ) {statements; }

Description

This procedure provides a table context which allows using partial table specificactions in the subsequent statement or code block. If a context is already available, then it will be superseded until the end of the statement or code block.

Call as: procedure

Restrictions

Indirect parameter passing is disabled
This function provides a table context for partial table specifications with table name, row number and optionally column number

Parameter count

2

Parameters

No.TypeDescription
1.
input
string Table Name

Name of exsting table

2.
input
numeral Row Number

Row number to apply apply

Examples

      table initialize ( colors, { { EN, FR }, { red, rouge }, { blue, blue }, { green, vert }, { yellow, jaune } } );

      with table ( colors, 2 )
      {
          echo( row(), ": ", [EN]," / ", [FR] );
      }
      // Without the context, the full table specification is requierd, see below
      echo( "2: ", [colors:EN,2]," / ", [colors:FR,2] );

Output

2: blue / blue
2: blue / blue
Try it yourself: Open LIB_Function_with_table.b4p in B4P_Examples.zip. Decompress before use.
Specify the columns as well
  table load( cities, "Examples\Cities.csv" );

  for (a[]=1, a[]<=4, a[]++)
      with table( cities, 2, a[]  )
      {
          echo("Header  : ", [.,0], new line, "Contents: ", [.], new line );
      }

Output 02

Header  : City
Contents: Washington

Header  : State/Province
Contents: D.C.

Header  : Inhabitants
Contents: 650000

Header  : Famous attraction
Contents: Lincoln Statue

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

See also

row
for all table rows
table process