Wc_File_Read; Wc_File_Read_Line - AMX NETLINX PROGRAMMING LANGUAGE Manual

Programming language
Table of Contents

Advertisement

NetLinx UniCode Functions (Cont.)

WC_FILE_READ

WC_FILE_READ_LINE

NetLinx Programming Language Reference Guide
This function reads a block of widechar data from the specified file.
SLONG WC_FILE_READ (LONG hFile, WIDECHAR Buffer[ ], LONG
BufLen)
Parameters:
• hFile: Handle to the file returned by WC_FILE_OPEN
• Buffer: Buffer to hold the data to be read
• BufLen: Maximum number of characters to read
Result:
• >0: The number of bytes actually read
• -1: Invalid file handle
• -5: Disk I/O error
• -6: Invalid parameter
• -9: End-of-file reached
This function reads (from the current location of the file pointer) the number of
characters specified by BufLen (or fewer bytes if the end of file is reached).
The characters are read from the file identified by hFile and are stored in
Buffer. The file pointer will automatically be advanced the correct number of
bytes so the next read operation continues where the last operation left off.
WIDECHAR wcBuffer[1024]nBytes = WC_FILE_READ (hFile,
wcBuffer, 1024)
This function reads a line of widechar data from the specified file.
SLONG WC_FILE_READ_LINE (LONG hFile, WIDECHAR Buffer[ ],
LONG BufLen)
Parameters:
• hFile: Handle to the file returned by WC_FILE_OPEN
• Buffer: Buffer to hold the data to be read
• BufLen: Maximum number of characters to read
Result:
• =0: The number of bytes actually read
• -1: Invalid file handle
• -5: Disk I/O error
• -6: Invalid parameter (buffer length must be greater than zero)
• -9: End-of-file reached
This function reads from the current location of the file pointer up to the next
carriage return or to the end-of-file (EOF), whichever comes first. A complete
line will not be read if the buffer length is exceeded before a carriage return (or
EOF) is encountered. The characters are read from the file identified by hFile
and are stored in Buffer. The <CR> or <CR><LF> pair will not be stored in
Buffer. If a complete line is read, the file pointer is advanced to the next char-
acter in the file after the <CR> or <CR><LF> pair or to the EOF if the last line
was read.
WIDECHAR wcBuffer[80]nBytes = WC_FILE_READ_LINE (hFile,
wcBuffer,80)
NetLinx UniCode Functions
177

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Netlinx studio 2

Table of Contents