>>Renoir,
>>Probably array you use is not a form property and not declared as public. IOW sounds a scope problem. ie:
>>
>
>Cetin (and Pamela and Deamon),
>
>The only way I have gotten this to work is to create the property array in the Init of the listbox instead of the form. It kept giving me an error that the property didn't exist when I would reference it in the listbox Init so I just created it there. Why is this? Does object's Init run before the form's? I even tried creating the property in the form's Load method with the same results. Very confusing... It works the way I've done it now, but I still don't understand it.
>
>Also, how do I declare a form property array public in code? I'm using the following to create and dimension:
>
>ThisForm.AddProperty('SeeAlso(1)','')
>Dime ThisForm.SeeAlso(1)
>
>Renoir
Renoir,
Init of form is the last one run. First the innermost object init runs, then its parent, then parent.parent ... and last form.
But form.load runs before any init. You could populate array there and works.
With this
.addproperty('aMyLstArray[10,2]')
for ix=1 to alen(.aMyLstArray,1)
.aMyLstArray[ix,1] = 'ID'+padl(ix,5,'0')
.aMyLstArray[ix,2] = 'P'+padl(ix,5,'0')
endfor
Endwith
Listbox propperties :
columncount=alen(thisform.aMyLstArray,2)
numberofelements=alen(thisform.aMyLstArray,1)
rowsourcetype=5
rowsource='thisform.aMyLstArray'
* At runtime change array content and repoulate listbox
* A commandbutton click
WITH thisform
DIMENSION .aMyLstArray[20,5]
FOR ix=1 to alen(.aMyLstArray,1)
FOR jx=1 to alen(.aMyLstArray,2)
.aMyLstArray[ix,jx] = 'R'+padl(ix,2,'0')+'_C'+padl(jx,2,'0')
ENDFOR
ENDFOR
WITH .List1
.clear
.NumberOfElements = alen(thisform.aMyLstArray,1)
.ColumnCount = alen(thisform.aMyLstArray,2)
.Requery
ENDWITH
ENDWITH
Cetin