parentheses within string break value()

Dr. Hawkins dochawk at gmail.com
Mon Oct 26 16:25:03 EDT 2015


On Mon, Oct 26, 2015 at 9:49 AM, Bob Sneidar <bobsneidar at iotecdigital.com>
wrote:

> Now I get "Abc"45"123(def)" in tTest. I'm not sure what you are expecting,
> but that is what is getting passed to value(). If you asked me to resolve
> that, I would probably toss a few errors, not to mention a few brews, back
> myself.
>

I seem to have mis-parsed that myself.

There is a custom property (call it theProp) with a value like

"SELECT foo FROM " & tableName & " WHERE (bar > 7) AND (animal<>'cat');"



So those quotes and & are in the string to be evaluated.

My understanding of parsing is that the first piece should evaluate to

SELECT foo FROM


the second to

SELECT foo FROM


and the third to

WHERE (bar > 7) AND (animal<>'cat');


and when concatenated produce a string of

SELECT foo FROM theRealTableName WHERE (bar > 7) AND (animal<>'cat');

That is, I should get three strings, the first and last literals, and the
middle from evaluation of the variable name, which in turn should
concatenate by the &.

Instead, though, the quotation marks in the third string are ignored, and
instead of treating it as as string literal, an attempt is made to evaluate
it.


-- 
Dr. Richard E. Hawkins, Esq.
(702) 508-8462



More information about the use-livecode mailing list