Element: blob.insert ( )

Syntax

<ident> = <blob>.insert(<pos>, <blob2>)

   or

<blob>.insert(<pos>, <blob2>)

Type

blob or procedure

Description

A function which inserts the contents of another blob into the blob in question at a specified byte position.

If called as part of a blob assignment or expression, the return value of this function is the merge of the blob and another blob (parameter blob2). The original blob is left unchanged.

If called stand-alone, there is no return value but the blob has the contents of blob2 inserted into it.

This function has 2 parameters: pos, the byte position after which insertion is to take place (1 is the first byte), and blob2, a blob expression yielding the blob to be inserted.

The code of this function cannot be redefined.

Examples

Insert one blob into another, after byte 100:

myblob.insert(100,yourblob)

Merge 2 blobs, returning the result into a 3rd blob:

blob newblob = myblob.insert(100,yourblob)

See Also

Commands:

blob

Structures:

blob, blob.append, blob.part, blob.replace