Bookshelf Home | Contents | Index | PDF |
Siebel eScript Language Reference > Siebel eScript Commands > File I/O Methods in eScript > Clib.fscanf() MethodThis function reads data from a specified file and stores the data items in a series of parameters. SyntaxClib.fscanf(filePointer, formatString, var1, var2, ..., varn) ReturnsThe number of input items assigned. This number may be fewer than the number of parameters requested if there was a matching failure. If there is an input failure (before the conversion occurs), this function returns EOF. UsageThis function reads input from the file indicated by filePointer and stores that input in the var1, var2, ..., varn parameters following the formatString value according to the character combinations in the format string, which indicate how the file data is to be read and stored. The file must be open, with read access. Characters from input are matched against the formatting instruction characters of formatString until a percent character (%) is reached. The % character indicates that a value is to be read and stored to subsequent parameters following formatString. Each subsequent parameter after formatString gets the next parsed value taken from the next parameter in the list following formatString. A parameter specification takes this form: For values for these items, see Formatting Input in eScript. ExampleThe following example shows uses of Clib.fscanf() with various options on the parameters. var int1; The script produces the following trace output: COMMENT,"Monday, 10, 18, 0" See Also |
Siebel eScript Language Reference |