|
Skip
|
|
|
The Skip method moves current file position by specified offset and returns number of bytes actually skipped.
C++
long Skip(
long Offset // offset of new position
);
BASIC
Skip(
Offset As Long // offset of new position
) As Long
Parameters
- Offset
- Offset of new position specified as number of bytes to move file position from current position.
If this parameter is positive file position is moved forward (towards end of file).
If this parameter is negative file position is moved backward (towards beginning of file).
Return Values
If the method succeeds, the return value is the number of bytes file position was actually moved by.
If the method fails, the return value is failure code and error code is set.
Call GetError to get error code.
Remarks
Method returns the number of bytes actually skipped, which may be smaller than specified offset, depending on current file position.
The return value is always a positive number, regardless of direction of movement. The return value can be 0 if file is already positioned
at the end of file or beginning of file.
Offset specifies position in file for accessing data with IXFile methods. Physical position of the file pointer remains unchanged until actual data access occurs.
Unsaved data present in internal buffer is flushed to the file prior to changing its position.
Position of the file set with the method can be located anywhere in the file or at the end of file (one byte beyond last byte in file);
file cannot be positioned beyond end of file.
See Also
SetPosition,
GetPosition,
Positioning File