Browse Subversion Repository
Contents of /trunk/doc/en/html/macro/command/filereadln.html
Parent Directory
| 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: 1371 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=iso-8859-1"> |
6 |
<title>filereadln</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>filereadln</h1> |
15 |
|
16 |
<p> |
17 |
Reads a line from file. |
18 |
</p> |
19 |
|
20 |
<pre class="macro-syntax"> |
21 |
filereadln <file handle> <strvar> |
22 |
</pre> |
23 |
|
24 |
<h2>Remarks</h2> |
25 |
|
26 |
<p> |
27 |
Reads a line from the file specified by <file handle>.<br> |
28 |
The line is written into the string variable <strvar>.<br> |
29 |
The file pointer is moved to the beginning of the next line.<br> |
30 |
If the file pointer reaches the end of the file while reading the line, the system variable "result" is set to 1. Otherwise, "result" is set to zero.<br> |
31 |
|
32 |
When a line only includes a new line, the string variable is empty and "result" is set to zero. |
33 |
</p> |
34 |
|
35 |
<h2>Example</h2> |
36 |
|
37 |
<pre class="macro-example"> |
38 |
; Open a file. |
39 |
fileopen fhandle 'test.txt' 0 |
40 |
|
41 |
:loop |
42 |
; Read a line from the file. |
43 |
<strong>filereadln</strong> fhandle line |
44 |
if result goto fclose |
45 |
; Display the line. |
46 |
messagebox line 'test.txt' |
47 |
; Repeat until the end of the file. |
48 |
goto loop |
49 |
|
50 |
:fclose |
51 |
; Close the file. |
52 |
fileclose fhandle |
53 |
</pre> |
54 |
|
55 |
</body> |
56 |
</html> |
|