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=iso-8859-1"> |
6 |
<title>findfirst, findnext, findclose</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>findfirst</h1> |
15 |
|
16 |
<p> |
17 |
Searches for the first file matching a string. |
18 |
</p> |
19 |
|
20 |
<pre class="macro-syntax"> |
21 |
findfirst <dir handle> <file name> <strvar> |
22 |
</pre> |
23 |
|
24 |
<h2>Remarks</h2> |
25 |
|
26 |
<p> |
27 |
The findfirst command searches for the first file matching the specified file name <file name>.<br> |
28 |
If the file is found, this command returns the directory handle in <dir handle>, returns the first file name in <strvar> and sets the system variable "result" to 1.<br> |
29 |
Otherwise, <dir handle>, <strvar> and "result" are set to -1, "" and 0, respectively.<br> |
30 |
If the findfirst command find the first file successfully, the directory handle can be used for the findnext command to search for the next file matching the specified <file name>.<br> |
31 |
<strong>The directory handle should be released by the findclose command.</strong> |
32 |
</p> |
33 |
|
34 |
|
35 |
<h1>findnext</h1> |
36 |
|
37 |
<p> |
38 |
Searches for the next file matching a string. |
39 |
</p> |
40 |
|
41 |
<pre class="macro-syntax"> |
42 |
findnext <dir handle> <strvar> |
43 |
</pre> |
44 |
|
45 |
<h2>Remarks</h2> |
46 |
|
47 |
<p> |
48 |
The findnext command searches for the next file matching the file name specified in the findfirst command.<br> |
49 |
The integer value <dir handle> should be the directory handle returned by the findfirst command.<br> |
50 |
If the next file is found, the file name is returned in <strvar> and "result" is set to 1.<br> |
51 |
Otherwise, <strvar> and "result" are set to "" and 0, respectively. |
52 |
</p> |
53 |
|
54 |
|
55 |
<h1>findclose</h1> |
56 |
|
57 |
<p> |
58 |
Releases a directory handle. |
59 |
</p> |
60 |
|
61 |
<pre class="macro-syntax"> |
62 |
findclose <dir handle> |
63 |
</pre> |
64 |
|
65 |
<h2>Remarks</h2> |
66 |
|
67 |
<p> |
68 |
The findclose command releases the directory handle <dir handle> returned by the findfirst command.<br> |
69 |
This command should be executed if the findfirst command is executed successfully. |
70 |
</p> |
71 |
|
72 |
<h2>Example</h2> |
73 |
|
74 |
<pre class="macro-example"> |
75 |
findfirst dh '*.txt' filename |
76 |
|
77 |
while result |
78 |
messagebox filename '*.txt' |
79 |
findnext dh filename |
80 |
endwhile |
81 |
|
82 |
findclose dh |
83 |
</pre> |
84 |
|
85 |
</body> |
86 |
</html> |