Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Three dimensional Array
Message
De
25/05/2006 23:47:25
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01125053
Message ID:
01125145
Vues:
17
>is it possible to create a three dimensional array in VFP?

Not directly, but you can do it yourself. Sctrictly speaking BFP only has one dimenssional arrays, with built in support for row, columnn referencing.

If you declare an array as LOCAL ARRAY laMyArray(2,3) what you are really doing is LOCAL ARRAY laMyArray(6). VFP just lets you use two suscripts to reference each element, but nothings stops you from using laMyArray(5) to reference the laMyArray(2,2) element.

So, knowing that VFP AELEMENT function just does: element number = (Row - 1) * Total Columns + Col if you want a 3 dimensional array like

array(3,3,3) just do LOCAL ARRAY laMyArray(3*3*3) and build your own function to refer to each element.

Carlos
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform