Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Tutorial, Course, or Book on ARRAY Handling?
Message
De
09/04/2015 14:47:00
Al Doman (En ligne)
M3 Enterprises Inc.
North Vancouver, Colombie Britannique, Canada
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro Documentation de produit
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Web
Divers
Thread ID:
01618082
Message ID:
01618090
Vues:
70
>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.
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform