Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Tutorial, Course, or Book on ARRAY Handling?
Message
From
09/04/2015 15:12:03
 
 
To
09/04/2015 15:01:55
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Product Documentation
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Web
Miscellaneous
Thread ID:
01618082
Message ID:
01618095
Views:
59
>>>Does anyone know of a book, course, or tutorial that will teach me how to handle deeper concepts of array handling, something beyond the regular 2-dimensional arrays? My client has one set of arrays that are nested to 10 levels deep. I know that someone on here will say, "Oh, that's a piece of cake (or easy)! An array is just an array."
>>
>>Can you give us an idea of what it's used for, and what you need to do? Is it used in support of something like a treeview? Or is there advanced math being used e.g. matrix operations?
>>
>>I don't know how much of this you already know but it may be useful for others:
>>
>>If you're working in VFP you have DIMENSION to create arrays, then you have to know the syntax for addressing array elements. VFP arrays are one-based (as opposed to many other languages where they are zero-based).
>>
>>There are various primitive functions available e.g.
>>
>>ACOPY()
>>ADEL()
>>AELEMENT()
>>AINS()
>>ASORT()
>>ASUBSCRIPT()
>>
>>VFP supports only 1- or 2-dimensional arrays. By "nesting" I suspect you've got a situation where the elements of a given array are themselves arrays, and so forth down as deep as 10 levels.
>>
>>If there's existing code, hopefully it includes some more advanced user-defined functions that let you do things like traverse the links/nesting levels. Code like that is often recursive (or it should be) which tends to be tricky and requires great care in maintaining or enhancing.
>>
>>As a side note, if you're working with something like a treeview, rather than using nested arrays you can use a single data table (i.e. DBF) and implement a linked list. Processing usually requires writing your own (usually recursive) UDFs. However, depending on what you want to do there may be the option to use dBASE-style ISAM processing (SCAN, GOTO, SKIP etc.) or even the SQL engine. If you're familiar with Fox you may find this approach more intuitive than using arrays.
>
>I use collections for n-dimensional stuff.

Yes, that's another valid approach. I haven't had occasion to go that way but it would probably be very useful if nodes are radically different from one another.

If node attributes are similar I really like the table/linked list approach. Great for reporting:

SELECT Various, Node, Columns FROM LinkedList WHERE ...
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform