Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Loopin a variable length array
Message
De
22/02/1999 03:25:38
 
 
À
22/02/1999 01:32:48
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00189697
Message ID:
00189894
Vues:
10
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
	
	
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform