Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Ascan and asubscript anomalies
Message
De
06/02/2006 11:11:50
 
 
À
06/02/2006 11:00:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 6 SP5
Divers
Thread ID:
01093967
Message ID:
01093974
Vues:
25
Alan,

The question was not whether an array can hold > 65000 elements, but

(1) has the return from ascan() been corrected
(2) has the return from asubscript() been corrected

>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
>>
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform