table length

Prev Next

Function Names

table length

Description

This function returns the number of rows

Call as: function

Restrictions

Indirect parameter passing is disabled

Parameter count

1

Parameters

No.TypeDescription
1
input
string name of table

Return value

TypeDescription
numeral Table length

Number of rows

Exceptions

Table not found

Examples

       table initialize ( table 1,
       { { Animal, leg count }, { Worm,  0}, { Bird, 2 }, { Dog, 4 }, { Fly, 6 }, { Tick, 8 } } );

       echo( table length( table 1 ) );

       table create ( table 2 );
       [ table 2: 0, 10 ] = Hi; // Note: row counting begins with zero

       echo( table length( table 2 ) );

Output

6
11
Try it yourself: Open LIB_Function_table_length.b4p in B4P_Examples.zip. Decompress before use.

See also

table row width