Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Ascan and asubscript anomalies
Message
De
06/02/2006 10:55:45
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Ascan and asubscript anomalies
Versions des environnements
Visual FoxPro:
VFP 6 SP5
Divers
Thread ID:
01093967
Message ID:
01093967
Vues:
60
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform