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>findfirst, findnext, findclose</title> |
<title>findfirst, findnext, findclose</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>findfirst</h1> |
<h1>findfirst</h1> |
15 |
|
|
16 |
<p> |
<p> |
17 |
文字列にあう最初のファイルを探す。 |
文字列にあう最初のファイルを探す。 |
18 |
</p> |
</p> |
19 |
|
|
20 |
<pre class="macro-syntax"> |
<pre class="macro-syntax"> |
21 |
findfirst <dir handle> <file name> <strvar> |
findfirst <dir handle> <file name> <strvar> |
22 |
</pre> |
</pre> |
23 |
|
|
24 |
<h2>解説</h2> |
<h2>解説</h2> |
25 |
|
|
26 |
<p> |
<p> |
27 |
findfirst コマンドはファイル名 <file name> にあう最初のファイルを探す。<br> |
findfirst コマンドはファイル名 <file name> にあう最初のファイルを探す。<br> |
28 |
ファイルが見つかった場合、ディレクトリハンドルが <dir handle> に、最初のファイル名が <strvar> に格納され、システム変数 <result> に 1 が格納される。<br> |
ファイルが見つかった場合、ディレクトリハンドルが <dir handle> に、最初のファイル名が <strvar> に格納され、システム変数 <result> に 1 が格納される。<br> |
29 |
findfirst コマンドが最初のファイルを見つけた場合、ディレクトリハンドルを指定して findnext コマンドを使用し、 |
findfirst コマンドが最初のファイルを見つけた場合、ディレクトリハンドルを指定して findnext コマンドを使用し、 |
30 |
<file name> にあう次のファイルを探すことができる。<br> |
<file name> にあう次のファイルを探すことができる。<br> |
31 |
<strong>ディレクトリハンドルは findclose コマンドによって解放されなければならない。</strong> |
<strong>ディレクトリハンドルは findclose コマンドによって解放されなければならない。</strong> |
32 |
</p> |
</p> |
33 |
|
|
34 |
|
|
35 |
<h1>findnext</h1> |
<h1>findnext</h1> |
36 |
|
|
37 |
<p> |
<p> |
38 |
文字列にあう次のファイルを探す。 |
文字列にあう次のファイルを探す。 |
39 |
</p> |
</p> |
40 |
|
|
41 |
<pre class="macro-syntax"> |
<pre class="macro-syntax"> |
42 |
findnext <dir handle> <strvar> |
findnext <dir handle> <strvar> |
43 |
</pre> |
</pre> |
44 |
|
|
45 |
<h2>解説</h2> |
<h2>解説</h2> |
46 |
|
|
47 |
<p> |
<p> |
48 |
findnext コマンドは findfirst コマンドで指定されたファイル名にあう次のファイルを探す。<br> |
findnext コマンドは findfirst コマンドで指定されたファイル名にあう次のファイルを探す。<br> |
49 |
整数値 <dir handle> は findfirst コマンドで得られたディレクトリハンドルでなければならない。<br> |
整数値 <dir handle> は findfirst コマンドで得られたディレクトリハンドルでなければならない。<br> |
50 |
もし次のファイルが見つかった場合、<strvar> にファイル名が、"result" に 1 が格納される。<br> |
もし次のファイルが見つかった場合、<strvar> にファイル名が、"result" に 1 が格納される。<br> |
51 |
それ以外の場合は、<strvar>と "result" にそれぞれ "" と 0 が格納される。 |
それ以外の場合は、<strvar>と "result" にそれぞれ "" と 0 が格納される。 |
52 |
</p> |
</p> |
53 |
|
|
54 |
|
|
55 |
<h1>findclose</h1> |
<h1>findclose</h1> |
56 |
|
|
57 |
<p> |
<p> |
58 |
ディレクトリハンドルを解放する。 |
ディレクトリハンドルを解放する。 |
59 |
</p> |
</p> |
60 |
|
|
61 |
<pre class="macro-syntax"> |
<pre class="macro-syntax"> |
62 |
findclose <dir handle> |
findclose <dir handle> |
63 |
</pre> |
</pre> |
64 |
|
|
65 |
<h2>解説</h2> |
<h2>解説</h2> |
66 |
|
|
67 |
<p> |
<p> |
68 |
findclose コマンドは findfirst コマンドによって得られたディレクトリハンドル <dir handle> を解放する。<br> |
findclose コマンドは findfirst コマンドによって得られたディレクトリハンドル <dir handle> を解放する。<br> |
69 |
このコマンドは findfirst コマンドがファイルを見つけた場合、実行されなければならない。 |
このコマンドは findfirst コマンドがファイルを見つけた場合、実行されなければならない。 |
70 |
</p> |
</p> |
71 |
|
|
72 |
<h2>例</h2> |
<h2>例</h2> |
73 |
|
|
74 |
<pre class="macro-example"> |
<pre class="macro-example"> |
75 |
findfirst dh '*.txt' filename |
findfirst dh '*.txt' filename |
76 |
|
|
77 |
while result |
while result |
78 |
messagebox filename '*.txt' |
messagebox filename '*.txt' |
79 |
findnext dh filename |
findnext dh filename |
80 |
endwhile |
endwhile |
81 |
|
|
82 |
findclose dh |
findclose dh |
83 |
</pre> |
</pre> |
84 |
|
|
85 |
</body> |
</body> |
86 |
</html> |
</html> |