Reserved Identifiers
123
NetLinx Programming Language Reference Guide
Keywords & Run-Time Library Functions (Cont.)
FILE_READ
This function reads a block of data from the specified file.
SLONG FILE_READ (LONG hFile, CHAR Buffer[ ], LONG BufLen)
Parameters:
•
hFile
: Handle to the file returned by
File_Open
•
Buffer
: Buffer to hold the data to be read
•
BufLen
: Maximum number of bytes 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
bytes specified by
BufLen
(or fewer bytes if the end of file is reached). The
bytes 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.
CHAR Buffer[1024]nBytes = FILE_READ (hFile, Buffer, 1024)
FILE_READ_LINE
This function reads a line of data from the specified file.
SLONG FILE_READ_LINE (LONG hFile, CHAR Buffer[ ], LONG
BufLen)
Parameters:
•
hFile
: Handle to the file returned by File_Open
•
Buffer
: Buffer to hold the data to be read
•
BufLen
: Maximum number of bytes 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 bytes 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 character in the
file after the <CR> or <CR><LF> pair or to the EOF if the last line was read.
CHAR Buffer[80]nBytes = FILE_READ_LINE (hFile, Buffer,
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...