SA_TxtRead
SA_TxtRead searches for a text record matching the conditions specified in the method and read that record.
int SA_TxtRead ( SA_FH TxtFH, u8 *Buffer, u32 BufLen, u32 Method );
or
int SA_TxtRead32 ( SA_FH TxtFH, u8 *Buffer, u32 BufLen, u32 Method );
Note the following:
{Buffer} size must be equal to or larger than the {reclen} parameter specified in SA_IsiPrep plus one (1) for null termination.
{Method} may be one of the following access values:
|
Value |
Meaning |
|
-1 |
Sequential read. |
|
-3 |
End of file. |
|
-4 |
Sequential prior. |
|
nn |
Random based on record size. |
Function return codes are as follows:
|
Value |
Meaning |
|
nn |
Number of bytes read + 1. |
|
0 |
No record found. |
|
-nn |
Error as described in Sunaccess Errors |
Use SA_TxtRead32 for 32 bit applications such as Visual Basic 6.0.
Examples:
long fh;
char buffer[2048];
SA_TxtRead(fh, buffer, sizeof(buffer), -1); // next record
SA_TxtRead(fh, buffer, sizeof(buffer), 42); // record 42
SA_TxtRead(fh, buffer, sizeof(buffer), -3); // end of file
SA_TxtRead(fh, buffer, sizeof(buffer), -4); // previous record
![]() |