swirl
Guide to OmniMark 7   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
      Other Library Functions  
function  

vfsMoveCursor

 
 

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"

        Other Library Functions
   vfsChangeDir
   vfsChangeOwner
   vfsChangePermissions
   vfsClose
   vfsConnect
   vfsConnectDir
   vfsCopy
   vfsCursorPosition
   vfsDeleteDir
   vfsDeleteFile
   vfsDescribe
   vfsDescribeFile
   vfsDir
   vfsDirName
   vfsDisconnect
   vfsFile
   vfsFileDir
   vfsFileName
   vfsIsVersionCompatible
   vfsLibraryVersion
   vfsLink
   vfsList
   vfsLock
   vfsMakeDir
   vfsMove
   vfsMoveCursor
   vfsOpen
   vfsRead
   vfsRename
   vfsTruncate
   vfsUnlock
   vfsWrite
 
 

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

OmniMark 7.1.2 Documentation Generated: June 28, 2005 at 5:46:05 pm
If you have any comments about this section of the documentation, send email to [email protected]

Copyright © Stilo Corporation, 1988-2005.