Unexpected "word" parsing

Peter Haworth pete at lcsql.com
Fri Dec 5 17:39:30 EST 2014


Yes, my tests were in the message box.

Not that a big deal now I know what it does.  Seems that the presence of a
space/tab/return word delimiter overrides the presence of a quoted string
within those delimiters.  Off to make a dictionary note.

Pete
lcSQL Software <http://www.lcsql.com>
Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and
SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html>

On Fri, Dec 5, 2014 at 1:19 PM, Peter M. Brigham <pmbrig at gmail.com> wrote:

> On Dec 5, 2014, at 1:26 PM, Peter Haworth wrote:
>
> > word 1 of a string like myProps["cProp"] returns the whole string. Word 2
> > returns"cProp"]
> >
> > Since cProp is enclosed in double quotes I was expecting:
> >
> > word 1 --> myProps[
> > word 2 --> "cProp"
> > word 3--> ]
> >
> > This is with LC 6.6.2/OSX.
>
> Does the same in LC 5.5, but only in the messagebox.
>
> myProps["cProp"]
> word 1 -> myProps["cProp"]
> word 2 -> "cProp"].
>
> Also in the messagebox, if you ask for word 3 or word 4 or word 63 of that
> string, you get "cProp"] as well, so there's something screwy about using
> the messagebox for this. But in a button script, it returns word 1 as the
> whole string and word 2 as empty, which is at least consistent. However,
> put a space in the middle of "cProp":
>
> myProps["c Prop"]
> word 1: myProps["c
> word 2: Prop"]
>
> So in this case a string surrounded by quotation marks is not treated as
> one word. BUT:
>
> myProps[ "c Prop" ]
> word 1: myProps[
> word 2: "c Prop"
> word 3: ]
>
> This scripting language is described as "english-like" and it's living up
> to its name -- every rule has its unexpected exceptions. Don't get me
> wrong, I love LC, but some things drive me nuts.
>
> -- Peter
>
> Peter M. Brigham
> pmbrig at gmail.com
> http://home.comcast.net/~pmbrig
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list