Siebel eScript Language Reference > Siebel eScript Commands > Buffer Object Methods >

subBuffer() Method


This method returns a new Buffer object consisting of the data between two specified positions.

Syntax

bufferVar.subBuffer(beginning, end)

Parameter
Description

beginning

The cursor position at which the new Buffer object should begin

end

The cursor position at which the new Buffer object should end

Returns

A new Buffer object consisting of the data in bufferVar between the beginning and end positions.

Usage

If beginning is less than 0, then it is treated as 0, the start of the buffer.

If end is beyond the end of the buffer, then the new subbuffer is extended with null bytes, but the original buffer is not altered. The unicode and bigEndian flags are duplicated in the new buffer.

The length of the new buffer is set to end - beginning. If the cursor in the old buffer is between beginning and end, then it is converted to a new relative position in the new buffer. If the cursor was before beginning, it is set to 0 in the new buffer; if it was past end, it is set to the end of the new buffer.

Example

This code fragment creates the new buffer language and displays its contents—the string "Siebel eScript".

var loveIt= new Buffer("I love coding with Siebel eScript!");
var language = loveIt.subBuffer(19, (loveIt.size - 1))
TheApplication().RaiseErrorText(language);

See Also

getString() Method

Siebel eScript Language Reference