Skip to main content

blob.seek(offset, offsetBasis)

Sets the location of the blob’s read/write pointer

Availability

Device + Agent

Parameters

Name Type Description
offset Integer The offset from the current location
offsetBasis Constant Optional single-byte constant to specify a point from which to apply the offset

Returns

Integer — 0 or -1

Description

This method moves the location of the blob’s read/write pointer. By default, it is provided as a positive offset from the start of the blob, but an optional origin point may be passed to the method using the second parameter. This option is a single-byte integer constant which can be passed using Squirrel’s character representation rather than as a numeric value.

Constant Location
'e' / 101 End of the blob
'c' / 99 Current position of the pointer
'b' / 98 Beginning of the blob

Attempts to set pointer beyond the start or the end of the blob will leave the pointer where it is. If this happens, the method returns the value -1; otherwise, 0 is returned.

The current location of the pointer can be determined using the tell() method.

Example Code