copy()  debug()

Chapter 5: General Objects and Methods

cut()

Description

Removes blob data, starting at location offset for a specified length, and places it into the blob or string destination, overwriting the contents of original destination blob. The first character in a blob is always at offset 0. If the offset plus the length is greater than the total length of the blob, or if the length is -1, the cut() method removes data from the offset position to the end of the blob.

Syntax

cut(int offset, int length, {blob | string} destination);

Parameter

Description

offset

Starting location to remove data. The first character in a blob is always at offset 0.

length

Amount (number of characters) of data to remove.

destination

blob or string in which to place the data.

Return value

Integer. Returns the length of data cut, if successful, and 0, if failed.

Examples

Example 43

blob other_blob;
pb->cut(5, 20, &other_blob);
blob my_blob;
string new_stuff;
my_blob = “abcdefghijk”;
new_stuff = “newblob”;
my_blob.cut(4, -1, &new_stuff);

Usage

Pointer to object

Object

pb->cut(5, 10, &my_other_blob);

myblob.cut(5, 10, &my_other_blob);

pb->cut(0, 4, &firstpart);

myblob.cut(0, 4, &firstpart);





Copyright © 2005. Sybase Inc. All rights reserved. debug()

View this book as PDF