# FmtOut

int FmtOut (char *formatString, source1, . . . , source

## Purpose

Formats the source1, . . . , sourcen arguments according to descriptions in the formatString argument. FmtOut writes the result of the formatting to the Standard I/O window.

The Using the Formatting and Scanning Functions section includes a complete discussion of FmtOut.

## Parameters

Input
Name | Type | Description
formatString | string | Contains format specifiers that appropriately describe the source and target data to be formatted. For the three format functions, the source specifiers must be provided in the format string. You may omit the target specifier, in which case the target is assumed to be %s (string). If a target data type other than string is desired, the format string must begin with the specifier of the desired target type, followed by the "‹" symbol, followed by the source specifiers. For example, the following calls are equivalent: x = Fmt (s, "%d", k) x = Fmt (s, "%s‹%d", k) The following list includes common specifiers:
%d | Indicates that the source or target is an integer.
%i | Same as %d.
%f | Indicates that the source or target is a double–precision real number.
%s | Indicates that the source or target is a string. Numeric values may be converted into ASCII form using the %s target specifier.
%10f | Indicates that the source or target is an array of ten double–precision real numbers.
Because the data formatting functions can describe many complex formatting operations, refer to the Using the Formatting and Scanning Functions section to make sure you are using the proper format specifier for your application.
source1, . . . , sourcen | Types must match | Specifies one or more arguments that are to be converted and written to the Standard Output. Each argument must match its corresponding type specifier in the format string. There may be up to 14 arguments. They must be separated by commas.

## Return Value

Name | Type | Description
n | integer | Number of source items successfully written to the Standard Output. To get the number of bytes written to the Standard Output, call NumFmtdBytes. This function returns –1 to indicate an error in the format string or –2 to indicate an I/O error. If this value is –2, you can use GetFmtIOError to get more information about the type of error that occurred.