Bookshelf Home | Contents | Index | Search | PDF | ![]() ![]() ![]() ![]() |
Siebel eScript Language Reference > Siebel eScript Commands > The Clib Object >
Clib.fclose() Method
This method writes a file's data to disk and closes the file.
Syntax
Clib.fclose(filePointer)
Returns
Zero if successful; otherwise, returns EOF.
Usage
This method flushes the file's buffers (that is, writes its data to disk) and closes the file. The file pointer ceases to be valid after this call.
Example
This example creates and writes to a text file and closes the file, testing for an error condition at the same time. If an error occurs, a message is displayed and the buffer is flushed.
function Test_Click ()
{
var fp = Clib.fopen('c:\\temp000.txt', 'wt');
Clib.fputs('abcdefg\nABCDEFG\n', fp);
if (Clib.fclose(fp) != 0)
{
TheApplication().RaiseErrorText('Unable to close file.' +
'\nContents are lost.');
}
else
Clib.remove('c:\\temp000.txt');
}See Also
Bookshelf Home | Contents | Index | Search | PDF | ![]() ![]() ![]() ![]() |
Siebel eScript Language Reference Published: 18 April 2003 |