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
pmb...@gmail.com
http://home.comcast.net/~pmbrig


_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to