vfsMoveCursor

function

Library: File system utilities (OMVFS legacy)
Include: omvfs.xin

Declaration
define external function vfsMoveCursor 
       value  vfsFile  file
   by  value  integer  offset
     
or

define external function vfsMoveCursor 
       value  vfsFile  file
   to  value  integer  absolute

Argument definitions

file
is the vfsFile object for the file in which the cursor is to be moved.
offset
is a relative cursor movement distance.
absolute
is an absolute cursor movement distance.


Purpose

Use vfsMoveCursor to change the cursor position from the current location in a file's contents to the position you specify.

Requirements

You must include the following line at the beginning of your OmniMark program:

  include "omvfs.xin"

file must:

offset

absolute

Specifying any other value for absolute will cause an exception to be thrown (external exception VFS209).

Usage Notes

If neither absolute or offset is specified, external exception VFS210 is thrown.

External exception VFS300 is thrown for any general OS operation failure. The text accompanying the exception will contain details on the reason for the failure.

Example

Move the cursor to the 200th position in the text, then move the cursor to the 210th position in the text, and finally output the text from position 210 to the end. The cursor finishes at the end of the file.

  include "omvfs.xin"
  
  process
     local vfsFile Cairo
     	. . .
     set Cairo to vfsOpen "cairo-doc.txt" for VFS-READ
     	. . .
     vfsMoveCursor Cairo to 200
     vfsMoveCursor Cairo by 10
     output "Contents after position 210:  " || vfsRead Cairo || "%n"