docs.intersystems.com
Home  /  Application Development: Core Topics  /  ObjectScript Reference  /  ObjectScript Functions  /  $ZSEEK


ObjectScript Reference
$ZSEEK
[Back]  [Next] 
InterSystems: The power behind what matters   
Search:  


Establishes a new offset into the current sequential file.
Synopsis
$ZSEEK(offset,mode)
Parameters
offset The offset into the current file.
mode Optional — An integer value that determines the relative position of the offset. The default is 0.
Description
$ZSEEK establishes a new offset into the current device. The current device must be a sequential file. If the current device is not a sequential file, $ZSEEK issues a <FUNCTION> error.
The mode parameter determines the point from which offset is based. Called without parameters, $ZSEEK returns the current position in the file
If there is no specifically set current device, $ZSEEK assumes that the device is the principal device.
Parameters
offset
The offset (in characters) from the point established by mode.
mode
The valid values are:
0 Offset is relative to the beginning of the file (absolute).
1 Offset is relative to the current position.
2 Offset is relative to the end of the file.
If you do not specify a mode value, $ZSEEK assumes a mode value of 0.
See Also