Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Loopin a variable length array
Message
From
22/02/1999 03:25:38
 
 
To
22/02/1999 01:32:48
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00189697
Message ID:
00189894
Views:
11
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
	
	
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform