Using the Print_table_name ~set/edit Option

The print_table_name option on the ~set and edit commands allows one to have sequential table names printed on the table that are not based on the actual table’s name stored in the DBfile. Using this option allows one, for example, to have tables named Q1, Q2a, Q2b, Q2c belabeled on the tables as table 1, 2, 3, and 4.

Print_table_name follows the same rules as that table_name uses. When setting the print_table_name, the name used must begin with an alpha character. If that character is followed by a number, the leading alpha character will be stripped off when the tables are printed, unless one has also set print_alpha_table_names. In order to have sequentiallynumbered tables starting with the number one, and only using the number of print positions necessary to print the numbers (i.e. not zero filled) use print_table_name=t1. (Note: “t” may be any letter.)

Using this option allows one to have meaningful tables names be used when tables are stored, such as ban1_Q1, but print the tables with simple sequential numbers, such as Table 1.

When print_table_name is set to a text string that ends with a number such as ban1_1, only the numeric portion of the string is incremented. Thus print_table_name=ban_1 would lead to tables named ban_1, ban_2, ban_3, … ban_12, ban_13, etc..

When the numeric portion of print_table_name is zero filled, the printed table names will be zero filled. Thus print_table_name=t001 will print table names as if one had used ~set autotab when the tables actually have meaningful names.

When print_table_name is set to text only, the text will be incremented alphabetically. Thus print_table_name=aa will name the tables aa, ab, ac, … az, ba, bb, etc.. When text only is used, the incremented table names will never use more text positions than the original setting. When all of the positions have been incremented at least once, the string will reset to “a”. Thus in the above example,table zz will be followed by another table aa.

Setting print_table_name to Q1a will label the tables 1a, 1b, 1a, 2a, 2b, etc.. (Note that the leading alpha character is removed.)


Example Spec:

~comment&prtname.doc~deftabset={one:col=: totalrow=: [1^1//5]stub={:onetwothreefourfive}}>printfile prtname1~set print_table_name=t1~input $~exctabset=onetab=ban1_q1tab=ban1_q2tab=ban1_q3tab=ban2_q1tab=ban2_q2tab=ban2_q3>listdb~end