The “$” format code is only used on output it is ignored during input formatting. However, if a “$” format code is found in the format specification, this default newline is not output. When IDL completes output format processing, it normally outputs a newline to terminate the output operation. Using the colon format code prevented a comma from being output following the final item in the argument list. Will output the following comma-separated list of integer values: 0, 1, 2, 3, 4, 5 The colon format code terminates format processing if there are no more data remaining in the argument list.įor example, the IDL statement, PRINT, FORMAT = '(6(I1, :, ", "))', INDGEN( 6)
Generates the following output: 123456 : Format Code See Padding and Natural Width Formatting for additional details on the output width of a formatted value.įor example, the IDL statement, PRINT, FORMAT = '(A6)', '123456789' On input, IDL strings have dynamic length, so w specifies the resulting length of input string variables. On output, if w is greater than the length of the string, the string is right justified. If w is not specified, the entire string is transferred. Is an optional width (0 ≤ w) specifying the number of characters to be transferred. Where the parameters “ n” and “-” are as described in Syntax and the width specification is as follows:
The A format code transfers character data. Use a C printf-style format string within a FORTRAN-style format. Tab to the n-th absolute position in the current record. On output, the string contents are written out. During output, skips the corresponding output list element. On input, returns the number of characters that remain to be transferred. Transfer binary, integer, octal, or hexadecimal values. No effect if data still remains on the list. Terminates format processing if no more items remain in the argument list. For example, if your data reside in tables of the following form: 26.01 92.555 344.2 101.0 6.123 99.845 23.723 200.02 141.93Įnsures that the correct number of digits are read or output for each element. Using a value of zero for the width parameter is useful when reading tables of data in which individual elements may be of varying lengths. The value is read or output using a default format without any leading or trailing whitespace, in the style of the standard C library printf() function. If the numeral zero is specified for the width parameter, IDL uses the “natural” width for the value.