Open-Source-Software-Entwicklung und Downloads

Browse Subversion Repository

Contents of /trunk/doc/jp/html/macro/command/filestrseek.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3227 - (show annotations) (download) (as text)
Tue Mar 24 15:10:33 2009 UTC (15 years, 1 month ago) by maya
File MIME type: text/html
File size: 1431 byte(s)
CVS から SVN へ移行: 改行コードを LF から CR+LF へ変換
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2 "http://www.w3.org/TR/html4/strict.dtd">
3 <html>
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
6 <title>filestrseek</title>
7 <meta http-equiv="Content-Style-Type" content="text/css">
8 <link rel="stylesheet" href="../../style.css" type="text/css">
9 </head>
10
11 <body>
12
13
14 <h1>filestrseek</h1>
15
16 <p>
17 文字列をファイルの先頭から末尾に向かって検索する。
18 </p>
19
20 <pre class="macro-syntax">
21 filestrseek &lt;file handle&gt; &lt;string&gt;
22 </pre>
23
24 <h2>解説</h2>
25
26 <p>
27 ファイルハンドル &lt;file handle&gt; で指定されるファイルから、文字列 &lt;string&gt; を検索する。<br>
28 検索は現在のファイルポインタの位置から開始する。検索はファイルの終わりの方に向かって行われる。逆方向の検索には "<a href="filestrseek2.html">filestrseek2</a>" コマンドを使用する。<br>
29 &lt;string&gt; が見つかった場合、ファイルポインタは &lt;string&gt; の次の文字の位置になり、システム変数 result に 1 が格納される。<br>
30 &lt;string&gt; が見つからなかった場合、ファイルポインタは移動せず、システム変数 result に 0 が格納される。
31 </p>
32
33 <h2></h2>
34
35 <pre class="macro-example">
36 fileopen fhandle 'teraterm.log' 0
37
38 ; ファイル "teraterm.log" から文字列 "abc" を検索し、
39 filestrseek fhandle 'abc'
40 if result=0 goto not_found
41 ; "abc" の次の文字からその行の終わりまでを読み込む
42 filereadln fhandle str
43
44 :not_found
45 fileclose fhandle
46 </pre>
47
48 </body>
49 </html>

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26