Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Weird BUG in SEEK
Message
From
25/09/2008 13:20:50
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Vista
Network:
Windows 2008 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01350643
Message ID:
01350673
Views:
40
>Try this:
>
>CREATE cursor TEMP (Fld1 I)
>
>INSERT INTO TEMP VALUES (100)      
>INSERT INTO TEMP VALUES (110)      
>INSERT INTO TEMP VALUES (113)      
>INSERT INTO TEMP VALUES (115)      
>INSERT INTO TEMP VALUES (119)      
>
>INDEX ON Fld1 TAG Temp
>
>SEEK [100 Test TestMe]
>? FOUND()              && .T. -> what!!!!!!!!!!!!!!!!!
>
>INDEX ON STR(Fld1) TAG Temp
>SEEK 100             && booom!!!!!
>? FOUND() 
>
>
>Maybe this is disused somewhere but I have missed that discussion.
>
>I always use ORDER in seek, but in ONE place I didn't and viola!!!!! what I found.
>When the order is based on Numeric (some kind) field you could seek strings and VFP didn't complain and above that IT FOUND() the string :-)))) (if the string begins with numbers)
>
>But if the order is STRING based you can't search anything but strings in it.
>Grrr!
>
>SO: ALWAYS USE "ORDER" clause in SEEK :-)

I confirm this happens with VFP9 SP1, and with VFP5 SP3. If it's been around that long, it's definitely a "feature, not a bug" :)

BTW when I first looked at your message I saw "viola" and "strings" so I thought you were talking about music ;) I think you mean, "voila".
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform