KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Deleting the selected rows of a listbox
PRODUCT: 4D | VERSION: 2004 | PLATFORM: Mac & Win
Published On: May 19, 2005
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

Compatible with 4D 2004.x

The new List Box object offers a myriad of ideas and uses. Here's a quick method you can write to allow a user to delete the selected rows of your list box.

`lbarray is the name of your List Box object
C_LONGINT($pos)

$pos:=0
Repeat
   $pos:=Find in array(lbarray;True;$pos)
   If ($pos>0)
      DELETE LISTBOX ROW(*;"lbarray";$pos)
      $pos:=0
   End if
Until ($pos<0)

Happy Coding!

Commented by Add Komoncharoensiri on July 3, 2017 at 9:00 AM
Hi Jody, it was a mistake indeed. The word "columns" in the last sentence has been replaced with "rows" now.
Commented by Jody Bevan on July 2, 2017 at 5:00 PM
The heading says deleting the selected Rows of a listbox. The code says deleting the selected columns of a listbox. Which is it?