InsertString Method (COMBOBOX / DATALIST)


PLBCMP GUI Only

 

The InsertString method adds a new string into a DATALIST or COMBOBOX object. The method uses the following format:

 

[label]

{object}.InsertString

[GIVING {return}] USING [*String=]{string}:

 

 

[*Index=]{index}

 

Where:

label

Optional. A Program Execution Label.

object

Required. A DATALIST or COMBOBOX object into which a new string is inserted.

return

Optional. A Numeric Variable that indicates the success or failure of the method.

string

Required. A Character String Variable or literal that specifies the new string.

index

Required. A decimal number or Numeric Variable that specifies the zero-based position of the new item.

Flags Affected: EOS, OVER, ZERO

Note the following:

  1. The string is inserted at the designated position regardless of the SORTED property. To insert the item in the sorted position, use the AddString method.

  2. Multiple logical records may be loaded in a single operation. An embedded 0x7F character in {data} is identified as a logical record terminator. The detection of the 0x7F is a default action by the runtime for the INSERTITEM and SETITEM instructions and the AddString and InsertString methods. These operations provide improved load times when using the PL/B Application Server. The feature may be enabled or disabled by using the SETMODE *USE7F instruction.

  3. If the method is successful, the zero-based index of the new string is returned. If the method is not successful, {return} will contain a -1.

  4. If the value returned is zero, the ZERO Condition Flag is set.

  5. The OVER and EOS Condition Flags are always cleared.

  6. For improved performance in the Application Server environment, do not specify the optional return value unless needed.

 

 

See Also: Method Syntax, DATALIST Methods, COMBOBOX Methods

 



PL/B Language Reference GetTopIndex Method (COMBOBOX / DATALIST) PreventKeyClickEvent (DATALIST)