SA_TxtWrite


 

SA_TxtWrite writes additional text records to an existing text file.

int SA_TxtWrite ( SA_FH TxtFH, u8 *Buffer, u32 BufLen, u32 Method );

or

int SA_TxtWrite32 ( SA_FH TxtFH, u8 *Buffer, u32 BufLen, u32 Method );

Parameters:
TxtFH
The handle of the previously opened or prepared text file.
Buffer
The buffer written by the operation.
BufLen
The length of the {Buffer}.
Method
An access parameter as described below that locates the record.

Note the following:

  1. Any record with a complete end of line sequence, CR/LF for DOS or LF for Linux, will lose all text in the record after that sequence on a subsequent record retrieval.

  2. A record longer than the {RecLen} parameter specified in SA_TxtPrep will be truncated.

  3. {Method} may be one of the following access values:

  4.  

    Value

    Meaning

    -1

    Sequential read.

    -3

    End of file.

    -4

    Sequential prior.

    nn

    Random based on record size.

     

  5. Function return codes are as follows:

  6.  

    Value

    Meaning

    nn

    Number of bytes written

    -nn

    Error as described in Sunaccess Errors

     

  7. Use SA_TxtWrite32 for 32 bit applications such as Visual Basic 6.0.

 

 



Sunaccess Reference SA_TxtRead SA_TxtUpdate