swirl
Guide to OmniMark 9   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Topics   Other Library Functions  
function  

vfs.move-cursor

 
 

Library: File system utilities (OMVFS)
Import: omvfs.xmd

Declaration

export external function move-cursor
        of      value file file-ref
        by      value integer offset optional
        to      value integer absolute optional

Argument definitions

file-ref
A vfs.file object representing the file in which the cursor is to be moved.
offset
The distance to move the cursor relative its current position.
absolute
The absolute position to move the cursor to.


Purpose

You can use vfs.move-cursor to change the position at which the next read of a file will occur. The position may be specified either relative to the current cursor position, or as an absolute position in a file. For instance, if you know that the data you are interested in starts at byte 100 in a file, you can read from that position like this:

  import "omvfs.xmd" prefixed by vfs.
  
  process
     local vfs.file test-file
     set test-file
      to vfs.open "c:/omnimark/projects/testfile.txt"
     vfs.move-cursor of test-file to 100
     output vfs.reader of test-file

You must specify either a relative or absolute movement, and not both.

Exceptions

The following exceptions may occur:

    Related Topics
 
Other Library Functions
 
 

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ LEGACY LIBRARIES ] [ ERRORS ]

OmniMark 9.1.0 Documentation Generated: September 2, 2010 at 1:38:10 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2010.