Example The following example creates and writes to a text file and then closes

Example the following example creates and writes to a

This preview shows page 220 - 224 out of 334 pages.

Example The following example creates and writes to a text file and then closes this file. It also tests for an error condition. If an error occurs, then it displays a message and clears the buffer: 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.'); }
Image of page 220
C Language Library Reference Clib File and Directory Methods Siebel eScript Language Reference Version 8.1, Rev. A 221 else Clib.remove('c:\\temp000.txt'); } For more information, see “Clib Clear Buffer Method” on page 239 . Clib Create Temporary File Method The Clib Create Temporary File method creates and opens a temporary binary file. It automatically removes the file pointer and the temporary file when Siebel CRM closes the file or when the code finishes. It returns one of the following values: If successful, then it returns the file pointer of the file that it created. If not successful, then it returns the following value: Null The location of where it creates the temporary file depends on how Clib is implemented on the operating system you use. Format Clib.tmpfile() Example For an example, see “Clib Get Characters to Next Line Method” on page 240 . Clib Create Temporary File Name Method The Clib Create Temporary File Name method creates a temporary file name. This name is not the same as the name of any existing file and it is not the same as any file name that this method returns while this code runs. It returns the file name as a string in the str argument. Format Clib.tmpnam([ str ]) Table 124 describes the arguments for the Clib Create Temporary File Name method. Table 124. Arguments for the Clib Create Temporary File Name Method Argument Description str A container that holds the name of the temporary file.
Image of page 221
Siebel eScript Language Reference Version 8.1, Rev. A C Language Library Reference Clib File and Directory Methods 222 Clib Delete File Method The Clib Delete File method deletes a file. It returns one of the following values: If successful, then it returns the following value: 0 If not successful, then it returns the following value: Negative 1 Format Clib.remove( filename ) Table 125 describes the arguments for the Clib Delete File method. Clib Lock File Method The Clib Lock File method locks or unlocks a file for simultaneous use by multiple processes. It returns one of the following values: If successful, then it returns the following value: 0 If not successful, then it returns a nonzero integer. Format Clib.flock( filePointer, mode ) Table 125. Arguments for the Clib Delete File Method Argument Description filename A string or string variable that contains the name of the file that this method deletes.
Image of page 222
C Language Library Reference Clib File and Directory Methods Siebel eScript Language Reference Version 8.1, Rev. A 223 Table 126 describes the arguments for the Clib Lock File method.
Image of page 223
Image of page 224

You've reached the end of your free preview.

Want to read all 334 pages?

  • Summer '16
  • Oracle
  • Type system, Siebel, Siebel eScript

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors