Performoutput of ASCII data:
PRINTF, unit, expr1, ... , exprn
expri The expressions to be output.
If the Format keyword is not present, PV-WAVE uses its default rules for formatting the output. These rules are described in Free Format Output in Chapter 8 of the PV-WAVE Programmer's Guide.
nums = INDGEN(10)
Create a 10-element integer vector that is initialized to the values of
; its one-dimensional subscripts.
OPENW, unit, 'printex.dat', /Get_Lun
Open the printex.dat file for writing.
PRINTF, unit, nums
Write the integers in nums to the file.
POINT_LUN, unit, 0
Rewind the file to the beginning.
n = INTARR(10)
Create a 10-element integer vector.
READF, unit, n
Read the contents of printex.dat into n.
PRINT, n, Format = '(10(i1, 1x))'
0 1 2 3 4 5 6 7 8 9
Display the formatted contents of variable n.
FREE_LUN, unit
Close the file and free the file unit number.