sitelogo
filepos, files, flush, reset_streams
MINERVA superseeded IF/Prolog. Please see http://www.ifcomputer.co.jp/MINERVA for details.

We discontinued to sell IF/Prolog Dec 31. 2003. For current customers, we continue to provide professional support for IF/Prolog until Dec 31, 2008.

filepos(-行番号) filepos(+ストリーム,-行番号) files flush flush(+ストリーム) reset_streams

filepos/1は、「行番号」を現在の入力ファイルの行番号と単一化します。

filepos/2は、「行番号」を「ストリーム」の現在の行番号と単一化します。「ストリーム」は、入力のために開かれていなければなりません。

files/0は、IF/Prologの管理しているすべてのファイルを現在の出力ストリ−ムに表示し、各ファイルのアクセスモ−ドや型を表示します。

flush/0は、現在の出力バッファを標準出力に書き出します(デフォルトは画面)。

flush/1は、現在の出力バッファを「ストリーム」に書き出します。

reset_streams/0は、ユ−ザによって(see/1, tell/1, trace/1, open/3を使って)開かれたファイルを閉じ、入出力ストリ−ムをデフォルト(現在の入力と出力を'user'に、現在のエラ−を'trace'に)リセットします。

?- see(infile), repeat, filepos(P), read(I). P = 1 I = line1; P = 2 I = line2 yes ?- files, seen. stdin file(stdin) [input,text] stdout file(stdout) [output,text] stderr file(stderr) [output,text] current_input file(infile) [input,text] current_output file(stdout) [output,text] current_error file(stderr) [output,text] infile file(infile) [input,text]

yes ?- _

stream_not_open 「ストリーム」が開かれていない out_of_range filepos/2では、「ストリーム」が入力用に開かれていなければならない


Up read on...
scroll to top managed with ubiCMS