Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Seeking a string in a numeric field is OK?
Message
 
 
To
15/10/2009 10:05:50
Mike Sue-Ping
Cambridge, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01429483
Message ID:
01429484
Views:
70
>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

I believe Boris discovered the same bug/feature few months back. See Weird BUG in SEEK Thread #1350643
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform