Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Three dimensional Array
Message
From
25/05/2006 23:47:25
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01125053
Message ID:
01125145
Views:
20
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform