__readFile
In this section:
Syntax
__readFile(fileHandle,valuePtr)
Parameters
fileHandleA macro variable used as filehandle by the __
openFilemacro.
valuePtrA pointer to a variable.
Return value
Result | Value |
|---|---|
Successful |
|
Unsuccessful | Non-zero error number |
Table 37. __ readFile return values
For use with
All C-SPY drivers.
Description
Reads a sequence of hexadecimal digits from the given file and converts them to an unsigned long which is assigned to the value parameter, which should be a pointer to a macro variable.
Only printable characters representing hexadecimal digits and white-space characters are accepted, no other characters are allowed.
Example
__var number;
if (__readFile(myFileHandle, &number) == 0)
{
// Do something with number
}In this example, if the file pointed to by myFileHandle contains the ASCII characters 1234 abcd 90ef, consecutive reads will assign the values 0x1234 0xabcd 0x90ef to the variable number.