Crestron simpl plus language ref 사용자 설명서

다운로드
페이지 374
Crestron SIMPL+
®
Software 
Language Reference Guide - DOC. 5797G
 SIMPL+
®
 
z 195
WriteSignedLongInteger
Name:
WriteSignedLongInteger
Syntax:
SIGNED_INTEGER WriteSignedLongInteger ( INTEGER 
file_handle,
SIGNED_LONG_INTEGER sli )
Description:
Writes data from a file starting at the current file position. Each element of the 
structure is written, without any padding bytes, that might actually be there in 
memory. Refer to the section entitled “Reading and Writing Data to a File” on page 
 for a discussion of when to use this function and when to use the related 
functions: FileWrite, WriteInteger, WriteString, WriteStructure, 
WriteSignedInteger, WriteLongInteger, WriteLongSignedInteger, 
WriteIntegerArray, WriteSignedIntegerArray, WriteLongIntegerArray, 
WriteLongSignedIntegerArray, WriteStringArray.
Use ReadSignedLongInteger to read this.
Parameters:
FILE_HANDLE specifies the file handle of the previously opened file (from 
FileOpen). 
SLI is the signed long integer whose value is written.
Return Value:
Number of bytes written to the file. If the return value is negative, it is an error code.
Example: 
(Refer to "File Functions Overview"on page 
)
INTEGER  nFileHandle, iErrorCode; 
SIGNED_LONG_INTEGER sli;
StartFileOperations();
nFileHandle = FileOpen ( “MyFile”, _O_WRONLY );
IF (nFileHandle >= 0) 
{
iErrorCode = WriteSignedLongInteger(nFileHandle, sli); 
if (iErrorCode > 0) 
PRINT ( “Written to file correctly.\n”); 
else 
PRINT ( “Error code %d\n”, iErrorCode); 
}
EndFileOperations();