Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Loopin a variable length array
Message
De
22/02/1999 03:31:54
 
 
À
22/02/1999 03:25:38
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00189697
Message ID:
00189895
Vues:
9
>I recommend that you operate off the end of the array instead of the beginning. Run this to see the difference:
>
>
>#define arraysize 1000
>
>dimension a[arraysize]
>
>for i = 1 to arraysize
>	a = space(1024)
>endfor
>
>? 'beginning'
>s = seconds()
>for i = arraysize to 1 step -1
>	adel(a, 1)
>	dimension a[i]
>endfor
>? seconds() - s
>	
>	
>dimension a[arraysize]
>
>for i = 1 to arraysize
>	a = space(1024)
>endfor
>
>? 'end'
>s = seconds()
>for i = arraysize to 1 step -1
>	dimension a[i]
>endfor
>? seconds() - s

>
Thanks,

I'll try it out.

regards,
Jim Edgar
Jurix Data Corporation
jmedgar@yahoo.com

No trees were destroyed in sending this message. However, a large number of electrons were diverted from their ordinary activities and terribly inconvenienced.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform