snip()  write()

Chapter 5: General Objects and Methods

truncate()

Description

Reduces the size of the blob to the number of characters identified in length. This method truncates the contents of the blob, starting from the rightmost position until the contents fit the new size. The truncate() method releases memory.

Syntax

truncate(int length);

Parameter

Description

length

Number of characters to reduce the size of the blob.

Return value

Integer. Returns the new blob size, if successful, and 0, if failed.

Examples

Example 50

blob myblob;
myblob = “abcdefg123456”;
myblob.truncate(7);

Usage

Pointer to object

Object

int smaller_size;

int smaller_size;

smaller_size = 22;

smaller_size = 45;

pb->truncate(smaller_size);

myblob.truncate(smaller_size);





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

View this book as PDF