File_Setdir; File_Write; File_Write_Line - AMX NETLINX PROGRAMMING LANGUAGE Manual

Programming language
Table of Contents

Advertisement

Keywords & Run-Time Library Functions (Cont.)

FILE_SETDIR

FILE_WRITE

FILE_WRITE_LINE

NetLinx Programming Language Reference Guide
This function sets the current working directory to the specified path.
SLONG FILE_SETDIR (CHAR DirPath[ ])
Parameters:
• DirPath: String containing the directory path.
Result:
• 0: Operation successful
• -4: Invalid directory path
• -5: Disk I/O error
Result = FILE_SETDIR ('\CDLIST\TEMP\')
This function writes a block of data to the specified file.
SLONG FILE_WRITE (LONG hFile, CHAR Buffer[ ], LONG BufLen)
Parameters:
• hFile: Handle to the file returned by File_Open.
• Buffer: Buffer containing the data to write.
• BufLen: Number of bytes to write.
Result:
• >0: The number of bytes actually written
• -1: Invalid file handle
• -5: Disk I/O error
• -6: Invalid parameter (buffer length must be greater than zero)
• -11: Disk full
The data will overwrite or append to the current contents of the file depending
on the current position of the file pointer.
CHAR Buffer[1024]Result = FILE_WRITE (hFile, Buffer,
1024)
This function writes a line of data to the specified file.
SLONG FILE_WRITE_LINE (LONG hFile, CHAR Line[ ], LONG
LineLen)
Parameters:
• hFile: Handle to the file returned by File_Open.
• Line: Buffer containing the line of data to write.
• LineLen: Number of bytes to write.
Result:
• >0: The number of bytes actually written
• -1: Invalid file handle
• -5: Disk I/O error
• -6: Invalid parameter (LineLen must be greater than zero)
• -11: Disk full
A <CR><LF> character pair is automatically appended to the end of the line.
CHAR Line[80]Result = FILE_WRITE_LINE (hFile, Line, 80)
Reserved Identifiers
125

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Netlinx studio 2

Table of Contents