Bookshelf Home | Contents | Index | Search | PDF |
Siebel eScript Language Reference > Siebel eScript Commands > The Clib Object >
Clib.fgets() Method
This method returns a string consisting of the characters in a file from the current file cursor to the next newline character.
Syntax
Clib.fgets([maxLen,] filePointer)
Returns
A string consisting of the characters in a file from the current file cursor to the next newline character. If an error occurs, or if the end of the file is reached, null is returned.
Usage
This method returns a string consisting of the characters in a file from the current file cursor to the next newline character. The newline is returned as part of the string.
Example
This example writes a string containing an embedded newline character to a temporary file. It then reads from the file twice to retrieve the output and display it, as shown in the illustration following the example.
function Test_Click ()
{
var x = Clib.tmpfile();
Clib.fputs("abcdefg\nABCDEFG\n", x);
Clib.rewind(x);
TheApplication().RaiseErrorText(Clib.fgets(x) + " " + Clib.fgets(x));
Clib.fclose(x);
}See Also
Bookshelf Home | Contents | Index | Search | PDF |
Siebel eScript Language Reference Published: 18 April 2003 |