Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Weird behavior of 'Additem' and 'AddListItem' method
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00015486
Message ID:
00015488
Views:
33
>Have somebody note the next situation :
>Lets say that you have a form with a list that has
>2 columns, my RowSourceType is set to 0-none,
>and in the init event of my form I receive an
>array that populates the list using the next code :
>
>PARAMETER aMyArray
>LOCAL x
>
>FOR m.x=1 TO ALEN(aMyArray,1)
> THISFORM.list1.addListItem(aMyArray(m.x,1),m.x,1)
> THISFORM.list1.addListItem(aMyArray(m.x,2),m.x,2)
>ENDFOR
>
>I did that to populate the two columns of my list,
>then Foxpro returned me an error:
> 'Not a numeric expression', in this line
>
>THISFORM.list1.addListItem(aMyArray(m.x,1),m.x,1)
>
>it doesn't recognize a memory variable, in this case
>m.x, to know in which line of the list you want to
>add the new item.
>I needed to 'cheat' foxpro to make it work, I did
>the next trick:
>THISFORM.list1.addListItem(aMyArray(m.x,1),EVAL(STR(m.x)),1)
>
>I used EVAL(STR(m.x)), so fox will think it has a
>a numeric expression, but it doesn't let you use the
>memory variable directly.
>I'm using 3.0, I don't know if this was fixed in 3.0b,
>I'm going to try it in 5.0 and see what happens.

try it w/ just 'x' (or better yet, something someone else would recognize like 'lnCount')
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform