Formatting the Database Size Estimation Output

You can format the output for your database size estimation. Sub-objects (such as columns and indexes) contained in a table are offset, and you can print additional information after the total.

The syntax for the output is as follows:
[object-size][:compartment]|[ObjectID][|label]
where:
For example, in the event handler defined on the Table metaclass (having calculated and stored the size of a table, the size of all the columns of type LONG contained in the table, and the size of each index in the table), we create a message variable to print this information. We begin by printing a line giving the size of a table:
message = CStr(TableSize) & "||" & objTable.ShortDescription & vbCrLf
We then add a line printing the total size of all the columns of type LONG in the table:
message = message & CStr(LongSize) & "||Columns of type LONG" & vbCrLf
We then add a line printing the size of each index in the table:
message = message & CStr(IndexSize) & "|" & objIndex.ObjectID & vbCrLf

In the event handler defined on the Tablespace metaclass (having calculated and stored the size of a tablespace), we create a message variable to print this information after the database size calculation has been printed.

We begin by overriding the default introduction to this second compartment:
message = ":1||Tables are allocated to the following tablespaces:"
We then add a line printing the size of each tablespace in the table
message = message + CStr(tablespaceSize) & ":1||" & objTablespace.ShortDescription
The result gives the following output:
Estimate of the size of the Database "Sales"...

 Number    Estimated size      Object
-------    --------------      ------------------------------------

 10,000           6096 KB      Table 'Invoices'
                                 Columns of type LONG (35 KB)
                                 Index 'customerFKeyIndex' (976 KB)
                                 Index 'descriptionIndex' (1976 KB)

	                       [...etc...]

 Tables are allocated to the following tablespaces:

           Estimated size      Object
           --------------      ------------------------------------
                  6096 KB      Tablespace 'mainStorage'

	                       [...etc...]