Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Seeking a string in a numeric field is OK?
Message
De
15/10/2009 10:05:50
Mike Sue-Ping
Cambridge, Ontario, Canada
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Seeking a string in a numeric field is OK?
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01429483
Message ID:
01429483
Vues:
141
Today I discovered that VFP does not care if you try to seek a string in a numeric field.

Has this always been the case? Try this code:
CREATE CURSOR csrJunk (f1 I, f2 B, f3 N(5,2))

INSERT INTO csrJunk VALUES (1, 1111.1111, 1.11)
INSERT INTO csrJunk VALUES (2, 2222.2222, 2.22)
INSERT INTO csrJunk VALUES (3, 3333.3333, 3.33)
INSERT INTO csrJunk VALUES (4, 4444.4444, 4.44)

INDEX on f1 TAG f1
INDEX on f2 TAG f2 ADDITIVE 
INDEX on f3 TAG f3 ADDITIVE  

WAIT WINDOW SEEK(3, "csrJunk", 1)		&& Returns .T.
WAIT WINDOW SEEK(3333.3333, "csrJunk", 2)	&& Returns .T.
WAIT WINDOW SEEK("3.30", "csrJunk", 3)		&& Returns .F. I expected a Data type mismatch error

WAIT WINDOW SEEK(.T., "csrJunk", 1)		&& Error - Data type mismatch
WAIT WINDOW SEEK({^2000/01/01}, "csrJunk", 1)	&& Error - Data type mismatch
Why doesn't the third wait window cause an error like I think it should! Bug? By design?

TIA
Mike
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform