Bookshelf Home | Contents | Index | Search | PDF |
Siebel eScript Language Reference > Siebel eScript Commands > Buffer Objects >
The Buffer Constructor
To create a Buffer object, use one of the following syntax forms.
Syntax A
new Buffer([size] [, unicode] [, bigEndian]);
Usage
If size is specified, then the new buffer is created with the specified size and filled with null bytes. If no size is specified, then the buffer is created with a size of 0, although it can be extended dynamically later.
The unicode parameter is an optional Boolean flag describing the initial state of the Unicode flag of the object. Similarly, bigEndian describes the initial state of the bigEndian parameter of the buffer.
Syntax B
new Buffer( string [, unicode] [, bigEndian] );
Usage
This syntax creates a new Buffer object from the string provided. If the string parameter is a Unicode string (if Unicode is enabled within the application), then the buffer is created as a Unicode string.
This behavior can be overridden by specifying true or false with the optional Boolean Unicode parameter. If this parameter is set to false, then the buffer is created as an ASCII string, regardless of whether the original string was in Unicode or not.
Similarly, specifying true makes sure that the buffer is created as a Unicode string. The size of the buffer is the length of the string (twice the length if it is Unicode). This constructor does not add a terminating null byte at the end of the string.
Syntax C
new Buffer(buffer [, unicode] [, bigEndian]);
Usage
A line of code following this syntax creates a new buffer object from the buffer provided. The contents of the buffer are copied as-is into the new buffer object. The unicode and bigEndian parameters do not affect this conversion, although they do set the relevant flags for future use.
Syntax D
new Buffer(bufferobject);
Usage
A line of code following this syntax creates a new Buffer object from another Buffer object. Everything is duplicated exactly from the other bufferObject, including the cursor location, size, and data.
Bookshelf Home | Contents | Index | Search | PDF |
Siebel eScript Language Reference Published: 18 April 2003 |