Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Foxpro arrays vs. Clipper arrays
Message
De
21/08/2001 08:20:22
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
21/08/2001 06:31:09
Ing. T.R.M. Pluym
Pluym Elektronics Bv
Hulst, Pays-Bas
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00546619
Message ID:
00546643
Vues:
17
>Hello all,
>
>I previously programmed in Clipper. We are now migrating to Foxpro.
>
>In Clipper we could fill an array row in the following way:
>
>============================================================
>LOCAL laArray
>
>laArray = ARRAY(2,4)
>
>laArray[1] = {'A','B','C','D'}
>
>? laArray[1,1] && Result = 'A'
>? laArray[1,2] && Result = 'B'
>? laArray[1,3] && Result = 'C'
>? laArray[1,4] && Result = 'D'
>============================================================
>
>Is there any syntax to use the "laArray[1] = {'A','B','C','D'}" in Foxpro ??
>
>An other problem is to create an empy array. I Clipper it works like this:
>
>============================================================
>LOCAL laArray
>
>laArray = {}
>
>? ALEN(laArray) && Result = 0
>============================================================
>
>How can I arrange this in Foxpro ? So fas as I can see the ALEN function always returns the value 1 or more, because i'm unable to create an emty array.
>
>Clipper also has additional ARRAY functions like AADD() is there a library to add these functions to Foxpro ?
>
>Thanks in advance,
>
>Theo Pluym

Theo,
Your entry point to Foxpro is the weakest one I think :( Unfortunately foxpro array handling is not that easy as in many other languages. You almost get the same results but from a longer route :

LOCAL array laArray[2,4]
laArray[1,1] = 'A'
laArray[1,2] = 'B'
laArray[1,3] = 'C'
laArray[1,4] = 'D'

You cannot unfortunately use famous {..} syntax. You cannot use an empty array too. In low level a variable and an array is differentiated by its dimension members. If both are 0 (rows and cols) then it's a nonarray variable. Thus at least one element for arrays.
There is no counterpart of aadd() I know of. There are a series of a*() functions in foxpro too but generally you end up creating your own library.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform