Next: , Previous: , Up: Internal Routines   [Contents][Index]

15.5.483 readf

readf, lun, var1 [, var2 …] [, /word]

readf(lun, var1 [, var2 …] [, /word])

Reads values into the specified variables from the formatted file which is open on logical unit lun. Numerical values are assumed to be separated by strings of whitespace and/or commas. Arrays and strings must be predefined. One value is read for each element of predefined arrays. Scalar and undefined variables get scalar values. The function form returns 1 when successful, 0 otherwise. By default, if an end-of-file is encountered before all variables are filled, then an error is generated in the subroutine form, or a 0 is returned by the function form.

By default, strings are taken to run up till the end of the line. If /word is specified, then strings are delimited by whitespace and/or commas just like for numerical values.

Upon exit, !read_count contains the number of read elements.

See also: printf, read, readu, !read_count