@READ [VDS6] |
|
| Top Previous Next | |
Syntax:
@READ(<identifier>, <number of bytes> {, TEXT|BINARY|HEX} )
@READ( CONSOLE, <number of bytes> )
Description:
This function returns a string consisting of the next <number of bytes> characters of bytes of data read from the open file <identifier>, starting from the current position in the file (or from the console, if CONSOLE is specified.)
The format of the data in the string can be specified using an optional third parameter, which may take one of the following values:
(omitted) |
(default) Data is returned exactly as it is in the file. If the data contains null bytes or other unprintable characters, some VDS commands or functions may not be able to use it. |
TEXT |
Data is returned as a string with one character per byte. Byte values of less than 32 are replaced by periods '.' so the data is not an exact representation of the file contents, but all text will be readable. |
BINARY |
Data is returned as a series of decimal numbers (one per byte) separated by the character specified using the command OPTION FIELDSEP (by default this is '|'). |
HEX |
Data is returned as a series of two-digit hexadecimal numbers (one per byte) separated by spaces. |
OK:
False if an error occurs reading the file (this includes attempts to read past the end of the file.)
Example:
%N = @READ(%%myfile,64)
See a more advanced example...
See also: