Crestron simpl plus language ref 사용자 설명서

다운로드
페이지 374
Software Crestron 
SIMPL+
®
122 
z SIMPL+
®
Language Reference Guide - DOC. 5797G
FileClose
Name:
FileClose
Syntax:
SIGNED_INTEGER FileClose (INTEGER handle) 
Description:
Closes a file opened previously by FileOpen. You MUST close a file that was 
opened, you won’t be able to open it again, or eventually the control system may hang 
or reboot. A reboot clears all open files. Files must be opened and closed during a 
single thread of operation. Refer to “StartFileOperations()” on 
.
Parameters:
HANDLE specifies the file handle of the previously opened file (from FileOpen).
Return Value:
Returns 0 if successful. Otherwise, file error code is returned.
Example: 
(Refer to  "File Functions Overview"on page 
)
SIGNED_INTEGER nFileHandle; 
StartFileOperations();
nFileHandle = FileOpen ( “MyFile”, _O_RDONLY );
IF (nFileHandle < 0)
{
PRINT(“Error Opening File MyFile\n”);
return;
}
IF ( nFileHandle > 0 ) 
{
IF ( FileClose ( nFileHandle ) <> 0 ) 
PRINT ( “Error closing file\n” ); 
EndFileOperations();
Version:
SIMPL+ Version 3.00.02 or higher (Pro 2 only)
Control System:
2-Series Only