Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Foxpro arrays vs. Clipper arrays
Message
De
21/08/2001 07:40:22
 
 
À
21/08/2001 07:33:47
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:
00546637
Vues:
21
Ahhh..
Again. no Sorry there's no built in AAdd or equivalent
in VFP I would do something like the following
Dimension laArray[aLen(laArray,1)+1]

I guess you could put this into a procedure library to simulate Clipper

It sounds like Clipper has better array functionality than VFP (Strange.. I have never even thought there were functions missing from VFP)

Will


>Correct,
>
>But Clipper has additional functions like AADD() here is the discription:
>
>===========================================================================
> Syntax
>
> AADD(, ) --> Value
>
> Arguments
>
> is the array to add a new element to.
>
> is the value assigned to the new element.
>
> Returns
>
> AADD() evaluates and returns its value. If is not
> specified, AADD() returns NIL.
>
> Description
>
> AADD() is an array function that increases the actual length of the
> target array by one. The newly created array element is assigned the
> value specified by .
>
> AADD() is used to dynamically grow an array. It is useful for building
> dynamic lists or queues. A good example of this is the GetList array
> used by the GET system to hold Get objects. After a READ or CLEAR GETS,
> GetList becomes an empty array. Each time you execute an @...GET
> command, the GET system uses AADD() to add a new element to the end of
> the GetList array, and then assigns a new Get object to the new element.
>
> AADD() is similar to ASIZE() but only adds one element at a time;
> ASIZE() can grow or shrink an array to a specified size. AADD(),
> however, has the advantage that it can assign a value to the new
> element, while ASIZE() cannot. AADD() may also seem similar to AINS(),
> but they are different: AINS() moves elements within an array, but it
> does not change the array's length.
>
> Note: If is another array, the new element in the target
> array will contain a reference to the array specified by .
>
> Examples
>
> þ These examples demonstrate the effects of multiple invocations
> of AADD() to an array:
>
> aArray := {} // Result: aArray is an empty array
> AADD(aArray, 5) // Result: aArray is { 5 }
> AADD(aArray, 10) // Result: aArray is { 5, 10 }
> AADD(aArray, { 12, 10 }) // Result: aArray is
> // { 5, 10, { 12, 10 } }
>
>
>===========================================================================
Will Jones
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform