FileReadString()
Summary
Reads a character string from a binary file.
Syntax
result = FileReadString(file f, integer length [, array options])
| Argument | Contents |
|---|---|
| f | A file handle |
| length | Maximum number of characters to be returned |
| Option | Type | Contents |
|---|---|---|
| EBCDIC | Boolean | "True" if EBCDIC character codes are used, "False" (default) if ASCII character codes are used |
Returns
The string as read from the binary file.
Notes
-
The options array is an optional argument.
-
The string is truncated at the first null character.
-
The returned string is no more than length-1 characters in length.
Error Codes
| Error Type | Meaning |
|---|---|
| Error | An error occurred reading from the file |
See Also
| Function | Summary |
|---|---|
| CloseFile() | Closes a file |
| FileWriteString() | Writes a character string to a binary file |
| OpenFile() | Opens a text or binary file on disk |