problem with brackets in script editor

Klaus Major klaus at major-k.de
Tue Mar 10 10:54:24 EDT 2009


Bonjour Andre,

> Bonjour,
>
> In order to keep trying Data Grid, I have to learn about « arrays  
> » (that I did not use up to now ).
> Well, I am reading the  article from Tom Healy « Arrays Examined »  
> in revUp, 57,  sept 26 2008.
> First trial : first example from Tom :
>
> ---------
> local tShoppingList,
> put "Apple" into tShoppingList[Fruit]
> put "Cornflakes" into tShoppingList[Cereal]
> put "Carrot" into tShoppingList[Veg]
> put "Lemonade" into tShoppingList[Drink]
> put tShoppingList[Fruit]
> -------
>
> In the message box, it works well (I get "Apple" ;-))
> Exactly the same in the script of a button, I can’t compile ; get an  
> error : first line with hint : ]
>
> Thanks in advance for any explanation and solution

you need to QUOTE teh keys of an array!
...
put "Apple" into tShoppingList["Fruit"]
...

That should do the trick.

> Best regards from Grenoble
>
> André

Best

Klaus

--
Klaus Major
klaus at major-k.de
http://www.major-k.de




More information about the use-livecode mailing list