Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dynamically Sizing Arrays
Message
De
31/05/2001 18:14:46
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
31/05/2001 18:04:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00513486
Message ID:
00513493
Vues:
20
>I have a situation where I need to add an unknown
>number of rows to an array. I think I have two
>options, 1) redimension the array for each new element
>that I need to add, or 2) concat everything to a string
>counting the elements as I go, then use something like
>WORDNUM() or ALINES() or some such, then redimensioning
>the array one time.
>
>My question is, efficiency wise, which would be the best
>solution?
>
>I'm running VFP 6, and I'm anticipating a maximum of
>maybe 50 rows.
>
>What say U?
>
> ...kt

First is the solution :) Saying concat I assume you'd get char data.
dimension myArray[1] && Initial declaration
....
* Add new element
dimension myArray[iif(type('myArray')='L',0,alen(myArray))+1]
myArray[alen(myArray)]=myVal
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform