Siebel eScript Language Reference > Methods Reference > Buffer Methods >

Put String in Buffer Method


The Put String in Buffer method replaces existing data in a buffer with a string that you specify. It replaces data starting at the current position of the cursor. This method does one of the following depending on if the Unicode flag in the buffer object is set:

  • Set. It puts the string in the buffer object as a Unicode string. It increments the cursor by twice the length of the string.
  • Not set. It puts the string in the buffer object as an ASCII string. It increments the cursor by the length of the string.

This method does not add a terminating null byte at end of the string.

To put a null string in the buffer object, you can use the following code:

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

Format

bufferVar.putString(string)

Table 58 describes the arguments for the Put String in Buffer method.

Table 58. Arguments for the Put String in Buffer Method
Argument
Description

string

The string literal that this method puts in the buffer object, or the string variable whose value it puts in the buffer object.

Example

The following example places the language string in the exclamation buffer and displays the modified contents of the explanation buffer:

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

This modification is a string that contains the following value:

I enjoy coding with Siebel eScript.

Related Topics

For more information, see the following topics:

Siebel eScript Language Reference Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Legal Notices.