table min/max width

Prev Next

Function Names

table min width, table max width

Description

table min width returns the number of columns in the narrowest row.
table nax width returns the number of columns in the widest row.
In both cases all rows will be considered, including the header row. Attention: Contents are already considered blank if they contain white spaces..

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 Width

Minimum resp. maximum number of columns

Exceptions

Table not found

Examples

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

       echo( table min width ( table 1 ), " and ", table max width ( table 1 ) );

       table create ( table 2 );
       [ table 2: 5, 10 ] = Hi; // column position 5 also counts the ones on the left: 0..4

       echo( table min width ( table 2 ), " and ", table max width ( table 2 ) );

Output

1 and 3
0 and 6
Try it yourself: Open LIB_Function_table_min_width.b4p in B4P_Examples.zip. Decompress before use.

See also

table row width