Next: Format Utility Functions, Up: Input and Output Formats [Contents][Index]
These functions construct struct fmt_spec
s and verify that they are
valid.
Constructs a struct fmt_spec
with the given type, w, and
d, asserts that the result is a valid input (or output) format,
and returns it.
Given input, which must be a valid input format, returns the equivalent output format. See Input and Output Formats in PSPP Users Guide, for the rules for converting input formats into output formats.
Returns the default output format for a variable of the given width. For a numeric variable, this is F8.2 format; for a string variable, it is the A format of the given width.
The following functions check whether a struct fmt_spec
is valid for
various uses and return true if so, false otherwise. When any of them
returns false, it also outputs an explanatory error message using
msg
. To suppress error output, enclose a call to one of these
functions by a msg_disable
/msg_enable
pair.
Checks whether format is a valid input format (for
fmt_check_input
, or fmt_check
if for_input) or
output format (for fmt_check_output
, or fmt_check
if not
for_input).
Checks whether format matches the value type type, that
is, if type is VAL_NUMERIC
and format is a numeric
format or type is VAL_STRING
and format is a string
format.
Checks whether format may be used as an output format for a value of the given width.
fmt_var_width
, described in
the following section, can be also be used to determine the value
width needed by a format.
Next: Format Utility Functions, Up: Input and Output Formats [Contents][Index]