Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Ascan and asubscript anomalies
Message
From
06/02/2006 10:55:45
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Ascan and asubscript anomalies
Environment versions
Visual FoxPro:
VFP 6 SP5
Miscellaneous
Thread ID:
01093967
Message ID:
01093967
Views:
61
Hi all,

I'm in the process of writing an array class - nothing fancy - and have come across the 32767 boundary

Just wondering whether the issues have been addressed in vfp7, vfp8 or vfp9
&& if nElementsSearched is defined
&&		if( (nStartElement > 32767) or (nElementsSearched > 32767) )
&&			it does not find the entry

dime pp[32000,2]
pp[32000,2] = 'a'
pp[32768] = 'b'


? [ascan(pp, 'a', 1) = 64000],  64000 = ascan(pp, 'a', 1) 	&& ok
? [assert ascan(pp, 'a', 1, 64000)], 64000 = ascan(pp, 'a', 1, 64000)		&& FALSE

? [ascan(pp, 'a', 32767, 64000+1-32767)], 64000 =  ascan(pp, 'a', 32767, 64000+1-32767)		&& ok
? [assert ascan(pp, 'a', 32768, 64000+1-32768)], 64000 = ascan(pp, 'a', 32768, 64000+1-32768)		&& FALSE

? [ascan(pp, 'b', 1, 32768)], 32768 = ascan(pp, 'b', 1, 32768) && FALSE
? [ascan(pp, 'b', 2, 32767)], 32768 = ascan(pp, 'b', 2, 32767) && OK

&& asubscript(..., 1) has also a problem with indexes > 32767

dime pp[32000, 2]
?asubscript(pp, 32766, 1) && OK
?asubscript(pp, 32767, 1) && OK
?asubscript(pp, 32768, 1) && OK
?asubscript(pp, 32769, 1) && 16384, should be 16385
?asubscript(pp, 32770, 1) && 16384, should be 16385

dime pp[21000, 3]
?asubscript(pp, 32767, 1) && OK
?asubscript(pp, 32768, 1) && OK
?asubscript(pp, 32769, 1) && OK
?asubscript(pp, 32770, 1) && 10923, should be 10924

dime pp[16000, 4]
?asubscript(pp, 64000, 1)

dime pp[13000, 5]
?asubscript(pp, 64000, 1)

dime pp[10000, 6]
?asubscript(pp, 60000, 1)


dime pp[8000, 8]
?asubscript(pp, 64000, 1)

&& etc
Gregory
Next
Reply
Map
View

Click here to load this message in the networking platform