>Hi there,
>
>I'm working on an application written in VFP 5.0. I have a list box on one of the forms, and on the INIT procedure, I have the following:
>
>with this.lstComp
> .AddListItem('0',1)
> .AddListItem('1',2)
> .AddListItem('2',3)
> .AddListItem('3',4)
> .AddListItem('4',5)
> .AddListItem('5',6)
> .AddListItem('6',7)
> .AddListItem('7',8)
> .AddListItem('8',9)
> .AddListItem('9',10)
>endwith
>
>But when I run the application in debug and select the '0' choice, the listbox.value = "". Whenever I choose one of the other selections (1-9), listbox.value equals the selection I chose.
>
>Any ideas how I can get my listbox.value and selcting '0' to work correctly?
>
>Thanks,
>
Joe, I just created the form in VFP 5 and put your code there, an it correctly shows "0" in Watch window for _screen.activeform.lstcomp.value
What is your setting for the RowSourceType?
Here is teh code from the Class Browser:
DEFINE CLASS form1 AS form
DoCreate = .T.
Caption = "Form1"
Name = "Form1"
ADD OBJECT lstcomp AS listbox WITH ;
Height = 180, ;
Left = 36, ;
Top = 36, ;
Width = 192, ;
Name = "lstComp"
PROCEDURE Init
with this.lstComp
.AddListItem('0',1)
.AddListItem('1',2)
.AddListItem('2',3)
.AddListItem('3',4)
.AddListItem('4',5)
.AddListItem('5',6)
.AddListItem('6',7)
.AddListItem('7',8)
.AddListItem('8',9)
.AddListItem('9',10)
endwith
ENDPROC
ENDDEFINE
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro
"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison