Siebel eScript Language Reference > Siebel eScript Commands > Buffer Objects >

putString() Method


This method puts a string into a buffer object at the current cursor position.

Syntax

bufferVar.putString(string)

Parameter
Description
string
The string literal to be placed into the buffer object, or the string variable whose value is to be placed into the buffer object

Returns

Not applicable

Usage

If the unicode flag is set within the buffer object, then the string is put into the buffer object as a Unicode string; otherwise, it is put into the buffer object as an ASCII string. The cursor is incremented by the length of the string, or twice the length if it is put as a Unicode string.

A terminating null byte is not added at end of the string.

To put a null terminated string into the buffer object, do the following:

buf1.putString("Hello");   // Put the string into the buffer
buf1.putValue( 0 );         // Add terminating null byte

Example

The following example places the string language in the buffer exclamation and displays the modified contents of explanation, which is the string, "I love coding with Siebel eScript".

function eScript_Click ()
{
   var exclamation = new Buffer("I love coding with . . .");
   var language = "Siebel eScript";
   exclamation.cursor = 19;
   exclamation.putString(language);
   TheApplication().RaiseErrorText(exclamation);
}

See Also

getString() Method


 Siebel eScript Language Reference 
 Published: 18 April 2003