ui.ListBox.RemoveItem()

ui.ListBox.RemoveItem() deletes an option from the list box.

Syntax

CALL <lbx_var>.RemoveItem("value")

Arguments

value

value of the list box option.

Can be STRING, INTEGER, BOOLEAN, or other depending on its type.

Usage and examples

Takes one argument - the value of the list box option:

CALL lbx.RemoveItem("value3")

.fm2 form:

before removeItem()

after removeItem()

This argument can be STRING, INTEGER, BOOLEAN, or other depending on its type:

CALL lbx.RemoveItem("one")

CALL lbx.RemoveItem(2)

CALL lbx.RemoveItem(TRUE)

By default, it is STRING because in .fm2, the default value type is StringLiteral.

 

If you have several list box options with the same value, ui.ListBox.RemoveItem() will remove these options one by one starting from the first option added to the .fm2 form:

.fm2 form:

before removeItem()

after removeItem()

 

You can pass a variable as an argument for ui.ListBox.RemoveItem() - for example, in order to select an option for removing at runtime (see example program, ui.ListBox.RemoveItem_02_definite):

LET remVal = fgl_winprompt(5, 3, "Type the option's value to remove it (Example: value3)", "", 25, 0)

IF remVal IS NOT NULL THEN

  CALL lbx.RemoveItem(remVal)

END IF

 

You use ui.ListBox.RemoveItem() with loops or other statements that take INTEGER parameters only if the value of the list box option is INTEGER (see example program, ui.ListBox.RemoveItem_01_for):

LET n = lbx.GetItemCount()

FOR i = 1 TO n

  CALL lbx.RemoveItem(i)

END FOR

This example will work only if values of the list box options are IntegerLiteral:

<ListBoxItem text="item1" identifier="f1_1">

  <ListBoxItem.value>

    <IntegerLiteral integerValue="1"/>

  </ListBoxItem.value>

</ListBoxItem>

 

 

Contact Us

Privacy Policy

Copyright © 2024 Querix, (UK) Ltd.