Linked text question

Klaus Major klaus at major-k.de
Thu Feb 17 10:06:25 EST 2005


Hi Mark,

> Thank you, Frank (and others),
>
> What is wrong with this expression?
>
>     repeat for each line x in field "WordList"
>       if the mouseText is among the items of line x of field 
> "WordList" then
>         answer "HEY"
>       end if
>     end repeat
>
> Rev doesn't like line 2, but I'm not able to understand why... if I 
> replace "x" with "1" the answer command executes.  What is the proper 
> repeat syntax to get this to work?

actually x contains the CONTENT of the line and not the number!

You could do this:

...
  put 1 into myLine
   repeat for each line x in field "WordList"
       if the mouseText is among the items of line myLine of field 
"WordList" then
         answer "HEY"
       end if
      add 1 to myLine
     end repeat
...

Hope that helps.

> Thanks,
> Mark

Regards

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



More information about the use-livecode mailing list