Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best way to remove items from a multi-select list.
Message
From
20/10/1999 14:12:31
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Best way to remove items from a multi-select list.
Miscellaneous
Thread ID:
00278995
Message ID:
00278995
Views:
55
I wanted a method to remove all the items selected in a multi-select list. I ended up doing the following. I tried using the RemoveListItem, but since this is based on NewItemId which is constantly changing, the code became fairly convoluted.
WITH THIS.Parent.lstModelFee

	lnTotFees = .ListCount
	lnFeeSelected = 1
	FOR lnCurFee = 1 TO lnTotFees
		IF .Selected[ lnFeeSelected ]
			lnNodeId = VAL(.List[ lnFeeSelected, 4 ])
			THISFORM.mpRemoveFromList ( lnNodeId )

			.RemoveItem( lnFeeSelected )
		ELSE
			lnFeeSelected = lnFeeSelected + 1
		ENDIF	
	ENDFOR
	
ENDWITH

THIS.Enabled = .F.
Reply
Map
View

Click here to load this message in the networking platform