Subject Re: [IBO] TIBOQuery.Locate
Author Daniel Rail
Hi,

At April 23, 2003, 19:33, Helen Borrie wrote:

> Daniel,
> Do you have time to test your fix on a column name like "FIRST NAME"? Such
> an identifier is valid inside dblquotes. I suspect that the problem will
> persist in a case like this...

Actually I've sent another possible fix to Jason. And, "FIRST NAME"
would be recognized as a field name, see below for further information.

The modifications are in the function GetSQLFirstAndSkip and its local
function getValue. The changes checks if the return value from
getValue starts with '(:', ':', '(' or a number. Those are the
possibilities that I was able to think of. This change works for me,
but I know that you'll want to test it further to make sure it works
100% of the time.

After reviewing, there still are some cases where this code might not
work and would have to be taken into consideration (i.e.: FIRST10 and
"FIRST 10" as field names). Those are the only 2 type of samples that
I can think of, that wouldn't work. I you want to I can send you
privately the IB_Parse.pas that I sent to Jason. It's just what I
noticed is that it would transform FIRST10 into FIRST 10, unless it
would be mandatory that there is a space between FIRST and 10. The
validation on the return value of getValue that would be added is as
follows: if the first character of the return value is numeric, then
check to see if the previous character is a space, if it is not a space
then it is a field name and not the predicates FIRST or SKIP. But,
still after this additional check, there's still the scenario for the
field name "FIRST 10", unless it would be to verify that the character
preceeding the word FIRST is a double quote, and if it is so, then it
is a field name and not the predicate FIRST. And, what about someone
using FIRST as a parameter(i.e.: ':FIRST'). I would be able to make
these modifications tomorrow(it's 8pm for me right now).

Other than these modifications, I wouldn't know what other scenario
would have to be considered. Am I missing some.

--
Best regards,
Daniel Rail
Senior System Engineer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.filopto.com)