
NetLinx UniCode Functions
177
NetLinx Programming Language Reference Guide
NetLinx UniCode Functions (Cont.)
WC_FILE_READ
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)
WC_FILE_READ_LINE
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)
Summary of Contents for NETLINX PROGRAMMING LANGUAGE
Page 15: ...Table of Contents xiii NetLinx Programming Language Reference Guide...
Page 16: ...xiv NetLinx Programming Language Reference Guide Table of Contents...
Page 18: ...Introduction 2 NetLinx Programming Language Reference Guide...
Page 76: ...Language Elements 60 NetLinx Programming Language Reference Guide...
Page 106: ...Combining Devices Levels and Channels 90 NetLinx Programming Language Reference Guide...
Page 112: ...Master To Master M2M 96 NetLinx Programming Language Reference Guide...
Page 182: ...Reserved Identifiers 166 NetLinx Programming Language Reference Guide...
Page 204: ...NetLinx UniCode Functions 188 NetLinx Programming Language Reference Guide...
Page 244: ...Appendix B Glossary 228 NetLinx Programming Language Reference Guide...
Page 245: ...Appendix B Glossary 229 NetLinx Programming Language Reference Guide...