1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" |
2 |
"http://www.w3.org/TR/html4/strict.dtd"> |
"http://www.w3.org/TR/html4/strict.dtd"> |
3 |
<html> |
<html> |
4 |
<head> |
<head> |
5 |
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS"> |
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS"> |
6 |
<title>wait</title> |
<title>wait</title> |
7 |
<meta http-equiv="Content-Style-Type" content="text/css"> |
<meta http-equiv="Content-Style-Type" content="text/css"> |
8 |
<link rel="stylesheet" href="../../style.css" type="text/css"> |
<link rel="stylesheet" href="../../style.css" type="text/css"> |
9 |
</head> |
</head> |
10 |
|
|
11 |
<body> |
<body> |
12 |
|
|
13 |
|
|
14 |
<h1>wait</h1> |
<h1>wait</h1> |
15 |
|
|
16 |
<p> |
<p> |
17 |
文字列を待つ。 |
文字列を待つ。 |
18 |
</p> |
</p> |
19 |
|
|
20 |
<pre class="macro-syntax"> |
<pre class="macro-syntax"> |
21 |
wait <string1> [<string2> ...] |
wait <string1> [<string2> ...] |
22 |
</pre> |
</pre> |
23 |
|
|
24 |
<h2>解説</h2> |
<h2>解説</h2> |
25 |
|
|
26 |
<p> |
<p> |
27 |
文字列 <string1> [<string2> ...] のうち一つがホストから送られてくるか、タイムアウトが発生するまで MACRO を停止させる。文字列は最大 10 個まで指定できる。 |
文字列 <string1> [<string2> ...] のうち一つがホストから送られてくるか、タイムアウトが発生するまで MACRO を停止させる。文字列は最大 10 個まで指定できる。 |
28 |
</p> |
</p> |
29 |
|
|
30 |
<p> |
<p> |
31 |
システム変数 timeout か mtimeout が 0 より大きい場合、<timeout>.<mtimeout> 秒の時間がすぎるとタイムアウトが発生する。タイムアウトの値が 0 以下の場合は、タイムアウトは発生しない。 |
システム変数 timeout か mtimeout が 0 より大きい場合、<timeout>.<mtimeout> 秒の時間がすぎるとタイムアウトが発生する。タイムアウトの値が 0 以下の場合は、タイムアウトは発生しない。 |
32 |
</p> |
</p> |
33 |
|
|
34 |
<p> |
<p> |
35 |
これらのコマンドの実行結果はシステム変数 result に格納される。変数 result の値の意味は以下のとおり。 |
これらのコマンドの実行結果はシステム変数 result に格納される。変数 result の値の意味は以下のとおり。 |
36 |
</p> |
</p> |
37 |
|
|
38 |
<table> |
<table> |
39 |
<tr> |
<tr> |
40 |
<th>値</th> |
<th>値</th> |
41 |
<th>意味</th> |
<th>意味</th> |
42 |
</tr> |
</tr> |
43 |
<tr> |
<tr> |
44 |
<td>0</td> |
<td>0</td> |
45 |
<td>タイムアウト。どの文字列も来なかった。</td> |
<td>タイムアウト。どの文字列も来なかった。</td> |
46 |
</tr> |
</tr> |
47 |
<tr> |
<tr> |
48 |
<td>1</td> |
<td>1</td> |
49 |
<td><string1> を受信した。</td> |
<td><string1> を受信した。</td> |
50 |
</tr> |
</tr> |
51 |
<tr> |
<tr> |
52 |
<td>2</td> |
<td>2</td> |
53 |
<td><string2> を受信した。</td> |
<td><string2> を受信した。</td> |
54 |
</tr> |
</tr> |
55 |
<tr> |
<tr> |
56 |
<td>n</td> |
<td>n</td> |
57 |
<td><stringn> を受信した。n=1..10</td> |
<td><stringn> を受信した。n=1..10</td> |
58 |
</tr> |
</tr> |
59 |
</table> |
</table> |
60 |
|
|
61 |
<h2>例</h2> |
<h2>例</h2> |
62 |
|
|
63 |
<pre class="macro-example"> |
<pre class="macro-example"> |
64 |
; タイムアウトを30秒に設定。 |
; タイムアウトを30秒に設定。 |
65 |
timeout = 30 |
timeout = 30 |
66 |
|
|
67 |
; 文字列 "OK" か "ERROR" を待つ。 |
; 文字列 "OK" か "ERROR" を待つ。 |
68 |
Wait 'OK' 'ERROR' |
Wait 'OK' 'ERROR' |
69 |
; タイムアウトなら、:timeout へジャンプ。 |
; タイムアウトなら、:timeout へジャンプ。 |
70 |
if result=0 goto timeout |
if result=0 goto timeout |
71 |
; "OK" が来たなら、:ok へジャンプ |
; "OK" が来たなら、:ok へジャンプ |
72 |
If result=1 goto ok |
If result=1 goto ok |
73 |
; "ERROR" が来たなら、:error へジャンプ |
; "ERROR" が来たなら、:error へジャンプ |
74 |
If result=2 goto error |
If result=2 goto error |
75 |
|
|
76 |
; 行先頭の ">" か、行末の "complete." を待つ。(ASCIIコード10, 13は LF, CR) |
; 行先頭の ">" か、行末の "complete." を待つ。(ASCIIコード10, 13は LF, CR) |
77 |
wait #10'>' 'complete.'#13 |
wait #10'>' 'complete.'#13 |
78 |
|
|
79 |
; タイムアウトを100ミリ秒に設定。 |
; タイムアウトを100ミリ秒に設定。 |
80 |
timeout = 100 |
timeout = 100 |
81 |
mwait 'server response' |
mwait 'server response' |
82 |
</pre> |
</pre> |
83 |
|
|
84 |
</body> |
</body> |
85 |
</html> |
</html> |