IF Computer > IF/Prolog > Manuals > IF/Prolog V4.1 マニュアル > ユーザーズ・ガイド > 初めてのPrologのセッションのための準備 > 入力/出力 > ストリームの入/出力

ストリームの入/出力

IF/Prolog by Siemens
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.

通常のファイル入力/出力に加え、論理ストリームに対する入出力ができます。ストリームには、fileストリーム、stringストリーム、nullストリームの3種類があります。すべての入出力述語にはオプションのパラメータがあり、通常の入出力先であるcurrent_inputとcurrent_outputの代わりに使用するストリーム識別子を指定することができます。前節で述べたように、current_inputおよびcurrent_outputは、述語see/seeing/seen/あるいは/tell/telling/toldで変更できます。

次の例では、文字列にデータを送っています。

?- open(teststring, string(s), output ).

yes ?- write(teststring, 'This is a test n').

yes ?- stream_control(teststring, output(S)).

S = 'This is a test n' _ <-- ここで改行を押して下さい。

yes ?- _

ストリームの概念については、レファレンスマニュアルのストリームの項目を参照して下さい。

document: http://www.ifcomputer.co.jp/IFProlog/Manuals/v4.1/user_guide/prepare/inout/stream/print_de.html
published 2008/12/1 update 1995/11/7 (c) 1996-2006 IF Computer Japan
IF Computer 5-28-2 Sendagi, Bunkyo-ku Tel +81-3-5814-3352 start (AT) ifcomputer.com
Customer Support Tokyo 113-0022 Japan   http://www.ifcomputer.com
Back> managed with ubiCMS