Identifying the itemOffset
Gordon Tillman
got at mindspring.com
Wed Nov 17 12:45:29 EST 2004
Hi Greg,
I just tried your script...
> I have a field with a one line and ten items that are tab delimited,
> and the textStyle of each item is set to link. I've written a simple
> field handler that identifies the item offset, so that I can sort
> another field according to that item. The handler below returns the
> total number of items (always ten) and the item offset of the item
> clicked, so I should get (10 and 1), (10 and 2), ..., (10 and 9), (10
> and 10), depending on what I click on. The problem is, when I click
> on the tenth item, I get (10 and 7)! What am I doing wrong. Any
> advice would be much appreciated.
>
> Greg
>
> on mouseUp
> set the itemDelimiter to tab
> get the first line of me
> put "(" & the number of items in it && "and" && the itemOffset(the
> clickText,it) & ")"
> end mouseUp
It worked fine for me. I'm wondering if it is data dependent? Try
adding this line right before the line starting with "put":
set the wholeMatches to true
See if that helps.
--gordon
More information about the use-livecode
mailing list