DELETEITEM


7.8.5, PLBCMP GUI Only

square.png Objects

 

The DELETEITEM instruction removes a menu line from a list object. It also deletes text from an EDITTEXT object. It uses one of the following formats:

 

(1)

[label]

DELETEITEM

{object}[,{item}]

(2)

[label]

DELETEITEM

{dialog},{dialog-no}[,{item}]

 

Where:

label

Optional. A Program Execution Label.

object

Required. A previously defined and created object or object pointer containing an item to delete.

item

Optional. A Numeric Variable, Expression, or decimal constant that indicates the item within the object.

dialog

Required. A previously defined and created DIALOG object or dialog object pointer containing an object from which an item is deleted.

dialog-no

Required. A Numeric Variable, Literal, or Expression that contains the dialog item number of the COMBOBOX, POPUPMENU or DATALIST dialog item from which an item is deleted.

Flags Affected: NONE

Note the following:

  1. All items below the item removed have their item number reduced by one.

  2. No action occurs if {item} is less than one for the following objects: FLOATMENU, MENU, or SUBMENU.

  3. No action occurs if {item} is greater than the number of items in the object for the following objects: COMBOBOX, FLOATMENU, MENU, POPUPMENU or SUBMENU.

  4. All items are deleted if {item} is zero for a COMBOBOX, DATALIST or POPUPMENU object.

  5. All text is deleted if {item} is zero for an EDITTEXT object.

  6. All selected text is deleted if {item} is one for an EDITTEXT object.

  7. Format 2 is used if the DELETEITEM instruction is executed for a DIALOG object. The {dialog-no} operand contains the dialog item number of the COMBOBOX, POPUPMENU or DATALIST dialog item. If the dialog number is not for a COMBOBOX, POPUPMENU or DATALIST dialog item, a runtime error of O107 is generated.

  8. An object must be CREATEd before using DELETEITEM. If this is not done, a runtime error of O105 is generated.

 

 

See Also: Example Code, INSERTITEM, Object Instructions

 



PL/B Language Reference DEACTIVATE DESTROY