Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Listbox and Array Property and where to do what
Message
De
16/05/2001 08:54:17
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
16/05/2001 08:32:07
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00507493
Message ID:
00507758
Vues:
12
This message has been marked as the solution to the initial question of the thread.
>>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.
*form.load
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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform