
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.
If you specify an explicit minimum width value (via the m width parameter) for an integer format code, specifying a leading zero in the width parameter has no effect, since the output value is already padded with zeroes on the left to create an output value of the specified minimum width. If you specify the “-” flag to left-justify the output, specifying a leading zero in the width parameter has no effect, since there are no unused spaces to the left of the output value. When padding values with zeroes, note the following: Zero Paddingįor numeric format codes, if the first digit of the width parameter is a zero, IDL will pad the value with zeroes rather than blanks. Produces the following output: bbbbbbbbb300 For example, the following IDL statement PRINT, FORMAT= '(I12)', 300 When this happens, IDL will adjust either the contents of the output value or the width of the field, using the following mechanisms: Whitespace Paddingīy default, if the value being formatted uses fewer characters than specified by the width parameter, IDL pads the value with whitespace characters on the left to create a string of the specified width. The value being formatted may be shorter than the output width specified by the width parameter. Width specifications and default values are format-code specific, and are described with the format codes below. Is an optional flag that specifies that string or numeric values should be left-justified on output. Non-decimal numeric codes (B, O, and Z) allow the "+" flag, but ignore it. Normally, only negative numbers are output with a sign prefix. The "+" flag is only valid for numeric format codes.
Is an optional flag that specifies that positive numbers should be output with a "+" prefix. If n is not specified, a repeat count of one is used. Is an optional repeat count (1 ≤ n) specifying the number of times the format code should be processed. The syntax of a FORTRAN-style format code is: C Use the FORTRAN style to print out six numbers surrounded by curly braces: PRINT, INDGEN( 3), FORMAT = '("The values are: ", 3(" Syntax The FORTRAN-style format codes specify how data should be transferred using a format similar to that in the FORTRAN language.