Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multidimensional Arrays

Status
Not open for further replies.

RTorrance

Programmer
Apr 12, 2002
64
CA
In the application I am developing I have come across a part where I would require using a 4D array. I really don't like this idea as it gets a little hard to manage. If anyone has anyways of getting around this please let me know.
 
I've got good news and bad news - you won't have to worry about this in FoxPro - it only supports arrays up to two dimensions.

Rick
 
But it shouldn't be hard to fake it. if you want to have Array(2,3,5,7) for instance you just need to define 6 5 x 7 arrays and create a function or small program which will access the proper item in the proper array. Indeed, if you call it FindArrayItem(a,b,c,d) it even looks like a 4d array. Depending on how you want to do it, if a couple of the dimensions are small you can use a 'DO CASE' to select the proper array to use or if you don't have a fixed size to the array dimensions, you can construct an array call [something like ReturnValue = Array0203(5,7) from the parameters inside your function call. You'll have to use some form of EVAL(), or & or ( ) or " " or whatever to make it work, but if you can't figure it out by trial and error, just ask and someone will let you know the proper syntax. Dave Dardinger
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top