Using the FILL_TABLE Command

The fill_table command is a table manipulation operator used to load values into tables. It may appear in ~clean blocks and in procedures.

Syntax of fill_table:

FILL_TABLE region constantFILL_TABLE region USING initial_value col_increment row_increment


The simplest usage of fill_table is to fill a table’s region with a constant. You can fill an entire table with a constant by using modify. If you want to effect a particular region of a table, you should use fill_table.

The second form of fill_table is used to fill a table’s region with ascending or decending numbers. This is done by first setting an initial value for the region, and then applying a column and row increment to that number. If you only want the column to be incremented, the row increment should be set to zero. If you only want the row to be incremented, the column increment should be set to zero. Using a negative value for an increment will cause the table to be filled with descending values.

The first cell of the region will have both increments applied to the initial value and then the resulting value is loaded into the cell. An initial value of zero with an increment of one for the column and ten for the row will put the number eleven into the first cell of the region. Columns are filled from left to right, rows are filled from top to bottom. The initial value, column increment and row increment may each be a function, expression or variable.

Example Spec:

~comment&filltab.doc~clean'' Examples of using fill_table with a constantcreate tab1(=10, =10)=missingfill_table tab1(1 by all)=1say tab1fill_table tab1(2 by all)=2say tab1fill_table tab1(all by 1)=1say tab1fill_table tab1(all by 2)=2say tab1'' Examples of fill_table ... usingcreate tab2(=10, =10)=missingfill_table tab2(T by all) using 0,0,1say tab2m tab2 = missingfill_table tab2(all by T) using 0,1,0say tab2'' If a column/row has an increment of 0, it will not be incremented.m tab2 = missingfill_table tab2(T by all) using 0,1,0say tab2'' Using only part of a region.m tab2 = missingfill_table tab2(1 by 1 to last) using 0,0,1say tab2m tab2 = missingfill_table tab2(1 to last by 1) using 0,1,0say tab2'' same as above but decendingm tab2 = missingfill_table tab2(1 by 1 to last) using num_rows(tab2) - 1,0,-1say tab2m tab2 = missingfill_table tab2(1 to last by 1) using num_cols(tab2) - 1,-1,0say tab2m tab2 = missingfill_table tab2(1 to last by 1 to last) using num_cols(tab2) - 1,-1,-1say tab2m tab2 = missingfill_table tab2(all by all) using 0, 1, 10say tab2~end