$fread » History » Version 2
Per Amundsen, 12/08/2019 11:00 AM
| 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 | *Parameters* |
||
| 8 | |||
| 9 | name|N - Name of the file or the Nth file. |
||
| 10 | |||
| 11 | *Example* |
||
| 12 | |||
| 13 | <pre> |
||
| 14 | ; Open a file. |
||
| 15 | /fopen Example Example.txt |
||
| 16 | |||
| 17 | ; Add some text to the file. |
||
| 18 | /fwrite Example Hello World |
||
| 19 | |||
| 20 | ; Read the next line. |
||
| 21 | //echo -ag Next line is: $fread(Example) |
||
| 22 | |||
| 23 | ; Close the file. |
||
| 24 | /fclose Example |
||
| 25 | |||
| 26 | ; Delete the file. |
||
| 27 | /remove Example |
||
| 28 | </pre> |
||
| 29 | 2 | Per Amundsen | |
| 30 | -------------------------------- |
||
| 31 | |||
| 32 | *$fread(name|N, M, &binvar)* |
||
| 33 | |||
| 34 | Reads M bytes from an open file to a &binvar. |
||
| 35 | |||
| 36 | |||
| 37 | *Parameters* |
||
| 38 | |||
| 39 | name|N - Name of the file or the Nth file. |
||
| 40 | M - Number of bytes to read from current position. |
||
| 41 | &binvar - The &binvar to read into. |