Siebel eScript Language Reference > C Language Library Reference > Clib File Input and Output Methods >

Clib Get Cursor Position Method


The Clib Get Cursor Position method gets the current position of the file cursor in the file that the filePointer argument identifies. It stores this value in the position argument.

Format

Clib.fgetpos(filePointer, position)

Table 141 describes the arguments for the Get Pointer Position method.

Table 141. Arguments for the Clib Get Cursor Position Method
Argument
Description

filePointer

A file pointer that the Clib Open File method returns.

position

The current position of the pointer in the file that the filePointer argument identifies.

Example

The following example restores the cursor position. It does the following work:

  1. Writes two strings to a temporary text file.
  2. To save the position where the second string begins, it uses the Clib Get Cursor Position method.
  3. To set the file cursor to the saved position, it uses the Clib Set Cursor Position method:

    function Test_Click ()
    {
       var position;
       var fp = Clib.tmpfile();
       Clib.fputs("Melody\n", fp);
       Clib.fgetpos(fp, position)
       Clib.fputs("Lingers\n", fp);
       Clib.fsetpos(fp, position);
       var msg = Clib.fgets(fp));
       Clib.fclose(fp);
       TheApplication().RaiseErrorText(msg);
    }

Siebel eScript Language Reference Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Legal Notices.