SIMPOL Documentation

Blob Functions

This section contains the intrinsic functions that are used for working together with blob values.

.inblob()

Prototype

.inblob( <sourceblob> , <searchblob> )

Return types

.nul, .inf, integer

Description

Returns the one-based position of the first occurrence of one blob within another. If the subblob is not found then zero is returned.

Parameters

sourceblob
Type nameResult for an expression of this type in this parameter
.nul The result will be .nul
.inf The result will be .inf, unless the second parameter is .nul
blob The blob to find the subblob in
searchblob
Type nameResult for an expression of this type in this parameter
.nul The result will be .nul
.inf The result will be .inf, unless the first parameter is .nul
blob The subblob to search for. If this is the empty blob then the return value will be 0, unless the first parameter is .nul or .inf

.subblob()

Prototype

.subblob( <sourceblob> , <startpos> , <count> )

Return types

.nul, .inf, blob

Description

Extracts bytes a specified number of bytes from a specified position in a blob

Parameters

sourceblob
Type nameResult for an expression of this type in this parameter
.nul The result will be .nul
.inf The result will be .inf, unless another parameter is .nul
blob The blob to extract bytes from
startpos
Type nameResult for an expression of this type in this parameter
.nul The result will be .nul
.inf If the result will be a blob, then it will be the empty blob, ie. the function behaves as if byte extraction starts at the end of the blob.
integer The one-based position to start extracting bytes from. If this is zero or negative then the start position is the start of the blob. If it is greater than the length of the blob then an empty blob is returned.
count
Type nameResult for an expression of this type in this parameter
.nul The result will be .nul
.inf If the result is a blob then all bytes to the end of the blob are extracted
integer The number of bytes to extract. If this is negative no bytes are returned. If it is greater than the length from the start of the extraction to the end of the blob then bytes up to the end of the blob are returned.