grow()  load()

Chapter 5: General Objects and Methods

jam()

Description

Inserts space into a blob, starting at offset for a specified length, and initializes the new space with the character specified in the pad parameter. The first character in a blob is always at offset 0. You can use any standard notation in the pad parameter, including printable characters (“a”), hexadecimal notation (“0X40”), or octal notation (“\011”).

Syntax

jam(int offset, int length, char pad);

Parameter

Description

offset

Location to start inserting. The first character in a blob is always at offset 0.

length

Number of characters to insert.

pad

Character to use to initialize the new space. Enclose the character in single quotes.

Return value

Integer. Returns the amount of space inserted, if successful, and 0, if failed.

Examples

Example 46

blob myblob;
myblob = “abcdefg”;
myblob.jam(4, 5, ‘*’);

Usage

Pointer to object

Object

pb->jam(20, 10, ‘ ‘);

myblob.jam(20, 10, ‘ ‘);





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

View this book as PDF