next up previous contents index
Next: Db_table_residue Up: The O_heap_1 commands Previous: Read_formatted

Write_formatted

     

Write_formatted [param] [file] [format]

Write out a datablock file as an O database source file. The command prompts for a data block name, a file name, and a format specification, in standard FORTRAN syntax. For example:

write .lsq_rt_a_to_b junk.tmp (3f10.4)

When specifying the format manually, be aware that there must not be any spaces within the parenthesis.

If nothing is specified for the format, O will attempt to figure out how best to format the numbers in the datablock, both for maintaining accuracy and compactness. This algorithm is very efficient, so it is rarely necessary to specify the format manually. Also, with the default mechanism, you do not risk dumb mistakes like specifying an integer format for a floating point datablock. Occasionally, however, O will not be able to choose an adequate format. One example is when writing out the .lsq_rt_* datablocks; these contain a rotation matrix, where all the elements lie between -1.0 and 1.0, but the translation component can have a magnitude in the hundreds, and the default format will therefore not always be adequate to represent the rotation matrix with enough precision. In these cases, it is possible to override the assignment made by the program using the datablock .default_formats,   that specifies (datablock, format) pairs. For example:

.DEFAULT_FORMATS T 3 20
.lsq_rt_*  (5e)
.gs_real   (5e)
.sym_rt_*  (5e)

overrides the default format assignment for three groups of datablocks.

Wild cards are permitted in the specification of data block names. In this way one can write out the entire database in ASCII format, for porting to another computer, or just for saving. When using wild cards in the specification of datablocks, you can not specify the format manually.