|Command||basic.%rdhex C Function/BASIC Program
Applicable release versions: AP/Unix
|Category||BASIC Program (486)|
|Description||reads the number of bytes designated by "size" into "variable" from the file specified by "file.descriptor" returned by a previous call to "%open()", "%creat()" or "dup()" converting each byte into two ASCII hexadecimal characters.
A string of a size at least equal to 2 * "size" must have been assigned to "variable" before the call by either an explicit assignment (e.g. buffer=space(1000)) or by the "char" reserve statement, otherwise data will be truncated.
The function returns the number of bytes actually read or "-1" if an error occurred. If less than 2 * "size" bytes are returned, the content of the string beyond is undefined, as is usual in C. This function is the opposite of "%whex()".
|Syntax||n=%rdhex(file.descriptor, variable, size)|