Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select speed question
Message
 
To
25/12/2004 13:54:15
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00971916
Message ID:
00972153
Views:
19
>Hi Ben,

>Yes, it is bad that STR() is not optimized when it should be. It is limited to inexact >comparison only, i.e. SET ANSI is OFF. Is that the type of comparison you were >targeting in your projects?

>Thanks,
>Aleksey.


Hi Aleksey,

SET ANSI OFF is necessary at least in some circumstances. For example, a set of detail lines of an invoice may be retrieved by the following statement:
SELECT * FROM InvDetail WHERE InvoiceNo+STR(InvLineNo)='INV00001'
Here, InvoiceNo+STR(InvLineNo) is the primary key of the InvDetail table. (see message#051026 for more info)

Of course, I can think of a number of workarounds to the problem. However making such change to a large project is unfortunate and time consuming. I'd rather wait for a VFP9 service pack.

If you agree that VFP should optimize STR(), I think you will also agree that VFP should optimize other string functions (LEFT(), REPLICATE(), LEFT(), RIGHT(),...) when the parameter determining the length of the resulting string is a numeric literal. Therefore, the bug in VFP9 is not limited to STR().


Ben
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform