Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Ascan and asubscript anomalies
Message
From
06/02/2006 11:00:15
 
 
To
06/02/2006 10:55:45
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6 SP5
Miscellaneous
Thread ID:
01093967
Message ID:
01093970
Views:
17
From the vfp9 help:
Maximum # of elements per array.
 Normal: 2 gigabytes 

Member array: 2 gigabytes 

Array of member objects: 65,000
>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
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform