You are here: Core Reference > Coding > Scripting > ListBox.Delete

ListBox.Delete

The ListBox Control Object that is returned by the AddListBox function has a Delete function. The Delete function can be used to remove an entry from a specific position in the List Box.

Syntax

ControlObject.Delete (Index Number)

Where ControlObject. is the name of the variable (declared in your script) that is used to store the List Box Control Object that is returned by the AddListBox function.

Description

Removes an option from a specific position in the List Box.

When you delete an option in a List Box, the options that appear below the new option in the list have their Index Numbers reduced by 1. So, if you delete an option with an Index Number of 4, the option that previously had Index Number 5 will now have Index Number 4, the option that had Index Number 6 will have Index Number 5 and so on.

Arguments

Index Number {integer}

A number that corresponds to the position of the option in the List Box (descending order with 0 at the top and the highest number at the bottom of the List Box).

Returns

Integer

Example:

ListBox.Delete(2)

Where:

  • ListBox is the name of the variable used to store the List Box Control Object that is returned by the AddListBox function (which would be defined earlier in the script)
  • 2 is the Index Number for the deleted option.

The option that was previously associated with Index Number 3 will be associated with Index Number 2 once the existing Index Number 2 option has been deleted.


ClearSCADA 2015 R2