Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BINTOC question
Message
De
15/12/2004 11:31:14
Daniel Mory
ECI Solutions, Inc.
Indiana, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
BINTOC question
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
00969484
Message ID:
00969484
Vues:
45
I found an odd behvavior when using bintoc in an index an integer field.
if the table column has only ones and zeroes as values, it sorts differently if you set the key size to two or four bytes as opposed to one.
if the column contains other values, they all sort the same way.

here is a code example:
CREATE CURSOR temp (myfield I)
INSERT INTO temp VALUES (0)
INSERT INTO temp VALUES (1)
INSERT INTO temp VALUES (0)
INSERT INTO temp VALUES (0)
INSERT INTO temp VALUES (1)
INSERT INTO temp VALUES (1)
INSERT INTO temp VALUES (0)
INDEX ON BINTOC(myfield,1) TAG myindex1
INDEX ON BINTOC(myfield,2) TAG myindex2
INDEX ON BINTOC(myfield,4) TAG myindex3

SET ORDER to myindex1
BROWSE

SET ORDER to myindex2
BROWSE

SET ORDER to myindex3
BROWSE

USE

CREATE CURSOR temp (myfield I)
INSERT INTO temp VALUES (0)
INSERT INTO temp VALUES (1)
INSERT INTO temp VALUES (2)
INSERT INTO temp VALUES (0)
INSERT INTO temp VALUES (1)
INSERT INTO temp VALUES (1)
INSERT INTO temp VALUES (0)
INDEX ON BINTOC(myfield,1) TAG myindex1
INDEX ON BINTOC(myfield,2) TAG myindex2
INDEX ON BINTOC(myfield,4) TAG myindex3


SET ORDER to myindex1
BROWSE

SET ORDER to myindex2
BROWSE

SET ORDER to myindex3
BROWSE
Is this a bug? I don't understand why specifying different lengths for the key would make any difference.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform