next up previous contents index
Next: Convenience Up: Standard Predicates Previous: Term I/O   Contents   Index

Special I/O

fmt_read(+Format, types(+T1,+T2,...), args(-A1,-A2,...), -RetCode)

This predicate implements C-style formatted input. It reads the current input according to the Format string. Format has the same syntax as the input format in C. The term types(...) lists the types of the arguments; they must match the types specified in Format. Here, 1 means string, 2 means integer, and 3 means float. The term args() specifies the variables for the input. RetCode specifies the return code: 0 - ok; -1 - end of file.

read_line(-Line, -Status)

Reads the next line from the current input and puts it in Line. If the line is larger than the available buffer, then Status is 0. If the line was read in full, up to and including the newline character, then Status is 1.

fmt_write(+Format, args(-A1,-A2,...))

Similar to formatted write in C. The semantics of the arguments is the same as for fmt_read/4.

fmt_write_string(-String, +Format, args(-A1,-A2,...))

Like fmt_write/2, but the output string is placed in String.


next up previous contents index
Next: Convenience Up: Standard Predicates Previous: Term I/O   Contents   Index
Baoqiu Cui
2000-04-23