Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP List control - what am I missing here?
Message
 
 
To
23/07/2002 09:28:33
Mike Sue-Ping
Cambridge, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00681596
Message ID:
00681599
Views:
15
This message has been marked as the solution to the initial question of the thread.
You've to use AddListItem.
myList.AddListItem(cField1)
myList.AddListItem( cField2, myList.NewItemID, 2 )
>Hi,
>
>I am trying to add items to an existing two column VFP list using the AddItem() method. I scan thru a set of records using:
>
>myList.ADDITEM(cField1, , 1)
>myList.ADDITEM(cField1, , 2)
>
>and VFP gives an error ("Not a numeric expression") that I know is due to the missing second parameter to the ADDITEM() method. What I don't understand is that the documentation says,
>
>Syntax
>
>Control.AddItem(cItem [, nIndex] [, nColumn])
>
>nIndex
>
>...If you omit nIndex and the Sorted property is set to false (.F.), cItem is added to the end of the list portion of the ComboBox or ListBox control.

>
>How do I "omit nIndex"? I tried 0 but it doesn't work either! What I really want is for my list to work exactly as it says in the part of the help shown above. I have the Sorted property set to false and I want the items to be added to the end of the list.
>
>TIA
>
>Mike
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform