Calculates minimum field widths for printing data structures (R.W. Payne).
||What identifier and/or text to print for the structure (
||Data structures to be printed|
||Saves the minimum field widths|
||Number of decimal places to be used for numerical data structures; if unset, a default is obtained using the
||Number of spaces to leave before each value of the structure; default 1|
||How to represent factor values (
MINFIELDWIDTH can be used to calculate the minimum field width that would be required to print a data structure in an even column down the page using the
STRUCTURE parameter, and can be any of those supported by Genstat. The calculated field width is saved, in a scalar, by the
IPRINT option indicates how the values of each
STRUCTURE are to be labelled, so that the field widths will be wide enough for the column headings as well as the data values. The
identifier setting uses the identifier of the
STRUCTURE, while the
extra setting used the information that can be specified by the
EXTRA parameter when data structures are defined by directives like
TEXT. You can set
IPRINT=* to indicate that the values are not to be labelled by either of these. Alternatively, if
IPRINT is not specified, the default is taken from the
IPRINT attribute of the
STRUCTURE (which can be set by the
IPRINT option of
TEXT etc). This is the same default that is used by
IPRINT option is not specified.
With numerical structures, like variates or matrices, the
DECIMALS parameter specifies the number of decimal places that are to be used. If you set
DECIMALS to a scalar containing a missing value, the
DECIMALS procedure is used by
MINFIELDWIDTH to determine a default number of decimal places, and this is stored in the scalar so that you can use it later. The
DECIMALS procedure is also used to obtain a default if the
DECIMALS parameter is not set.
SKIP parameter specifies how many spaces are to be left before each element of each
STRUCTURE; default 1.
FREPRESENTATION parameter controls the printing of the factor values. The default is to print labels if there are any; if there are none, it is assumed that levels will be printed. The
ordinals setting represents the values by the integers 1 upwards.
Any restrictions are ignored.
Commands for: Input and output.
CAPTION 'MINFIELDWIDTH example'; STYLE=meta VARIATE X[1...7]; VALUE=!(0.1,0.2...0.9),!(11,21...91),!(-1...-9),\ !(-99,0,999),!(-999,0,99),!(-99,0,9999),!(0) SCALAR D[1...7],F[1...7] MINFIELDWIDTH [IPRINT=*] X; FIELDWIDTH=F; DECIMALS=D PRINT F,D; FIELD=11; DECIMALS=0 PRINT [IPRINT=*] X; FIELD=F; DECIMALS=D