IF Computer > IF/Prolog > Manuals > IF/Prolog V4.1 マニュアル > IF/Prolog Interfaces > Athena インタフェースマニュアル > X11.4 Toolkit によるプログラミング > イベントソ−スの追加とバックグラウンド動作 > xtAddTimeOut/4, xtRemoveTimeOut/1

xtAddTimeOut/4, xtRemoveTimeOut/1

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.

xtAddTimeOut(+TimeOutName, +Interval, +TimeOutPredicate, +ClientData) xtRemoveTimeOut(TimeOutName)

intrinsicsのXtAdd/RemovetimeOut()と同様の働きをします。

xtAddTimeOut/4は、Intervalミリ秒後に呼び出されるべきTimeOutPredicate/2を登録します。

TimeOutPredicateは、2つの引数をもつ述語でなければなりません。これは以下のように、タイムアウトイベントがディスパッチされた時に呼び出されます。 TimeOutPredicate(TimeOutName, ClientData).

TimeOutPredicateが1度呼び出されると、タイムアウトは削除されます。周期的に呼び出したい場合には、タイムアウトをコ−ルバック中で登録し直さなければなりません。

TimeOutPredicateは失敗してはならず、失敗した場合には例外"timeout_predicate_failed"が結果として起こります。

[user]. | write_timeout(TimeOutName, ClientData) :- write(' time_out callback '), write(TimeOutName), write(' with client_data '), write(ClientData), nl. |EOF yes ?- xtAddTimeOut(time_out_5000, 5000, write_timeout, xxx ), xtMainLoop. < after 5 seconds > time_out callback time_out_5000 with client_data xxx

yes ?- _

<xtAddtimeOut/4> integer_expected Intervalは整数でなければならない timeout_name_already_used TimeOutNameで指定したタイムアウトがすでに存在している illegal_timeout_predicate TimeOutPredicate/2が存在していない

<xtRemoveTimeOut/1> illegal_timeout この名前のタイムアウトは登録されていない

document: http://www.ifcomputer.co.jp/IFProlog/Manuals/v4.1/advanced_feature/athena/xtprog/addevent/xtadto/print_en.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