Page 1 of 1

When is a quote not a quote?

Posted: Mon Aug 25, 2014 8:03 pm
by DanShafer
I discovered this morning a peculiar behavior with the "quote" constant in LC. This problem is present in 6.6.2 and 6.7 (dp7). I suspect it's been around a while. For all I know, others have documented it.

If you use the command:

find quote in field 3

and are searching a field that contains strings enclosed in double-quotes, you'll find that the find command locates the first quotation mark but fails to find the trailing quotation mark. In a field with multiple strings enclosed in double-quotes, find reliably finds all opening quotes and ignores all closing quotes.

This may be a part of another strange behavior (which I believe *has* been previously reported and discussed): the command "find quote" boxes as found and returns in the foundChunk all of the characters following the quotation mark until it hits the first space (or white space character) or (apparently) punctuation. So if you do a

find quote in field 3

and the string "http:www.foo.bar", the find command boxes "http" as found and returns a 5-character foundChunk value.

I've searched the forums as thoroughly as I can and haven't seen this one discussed, which is somewhat surprising except that I often seem to be doing bizarre stuff nobody else is trying.

This one cost me about two hours today.

Re: When is a quote not a quote?

Posted: Mon Aug 25, 2014 9:01 pm
by FourthWorld
Interestingly "find string" seems to do what you're expecting:

find quote in field 3

I never use the find command myself so we'll have to rely on the wisdom of Jacque and others to explain the nuances of its six forms. It may be that this is a bug, or there may be a way this makes sense given the various forms of "find" and how they differ.

Re: When is a quote not a quote?

Posted: Mon Aug 25, 2014 11:26 pm
by dunbarx
Dan.

This works the same in HC. And Richard's "find string" finds the quote alone there as well. So it is old, old...

Continued finds locate subsequent individual quotes in both.

Craig Newman