Project

General

Profile

$fread » History » Version 5

Per Amundsen, 02/22/2023 04:53 PM

1 1 Per Amundsen
_Added in 1.9.0_
2
3
*$fread(name|N)*
4
5 2 Per Amundsen
Returns the next [[$crlf]] delimited line from an open file from the current position.
6 1 Per Amundsen
7 5 Per Amundsen
_See also [[/fopen]], [[/fclose]], [[/fwrite]], [[/fseek]], [[/flist]], [[$fgetc]], [[$feof]], [[$ferr]], [[$fopen]]._
8
9 1 Per Amundsen
*Parameters*
10
11
name|N - Name of the file or the Nth file.
12
13 3 Per Amundsen
*Properties*
14
15 4 Per Amundsen
.back - Returns the previous [[$crlf]] delimited line from an open file from the current position. *(AdiIRC only)*
16 3 Per Amundsen
17 1 Per Amundsen
*Example*
18
19
<pre>
20
; Open a file.
21
/fopen Example Example.txt
22
23
; Add some text to the file.
24
/fwrite Example Hello World
25
26
; Read the next line.
27
//echo -ag Next line is: $fread(Example)
28
29
; Close the file.
30
/fclose Example
31
32
; Delete the file.
33
/remove Example
34
</pre>
35 2 Per Amundsen
36
--------------------------------
37
38
*$fread(name|N, M, &binvar)*
39
40
Reads M bytes from an open file to a &binvar.
41
42
*Parameters*
43
44
name|N - Name of the file or the Nth file.
45
M - Number of bytes to read from current position.
46 1 Per Amundsen
&binvar - The &binvar to read into.
47 3 Per Amundsen
48
*Properties*
49
50
.back - Returns M bytes from an open file to a &binvar backwards. (AdiIRC only)