Find restricted to the current card?

Jim Ault jimaultwins at yahoo.com
Sun May 1 12:58:32 EDT 2011


if you
lock screen
put the sort id of this card into baseCd
push card
-- find
if the short id of this card is baseCd then exit to top
else
   answer 'the hit is not on the card you started on'
   pop card
end if

--the unlock screen will happen at the exit of the handler automatically

---
and this can get you close to your goal.  You may have to deal with  
user interface issues when their are multiple hits on one card and in  
multiple fields.  The surround rectangle may be difficult to manage,  
so you may have to find a way to select the hit string with code vs  
native Find command

Hope this helps

On May 1, 2011, at 8:50 AM, James Hurley wrote:

> I have a field with the script:
>
> on mouseUP
>   put the value of the clickline into tText
>   set itemdel to tab
>   put item 1 of tText into tText
>   find string  tText in field "thetext"
> end mouseUP
>
>
> When I click on a line in the field RR finds the string in the field  
> "theText" and a second click on the same line finds the next  
> instance of the string in the same field.
>
> But if, on subsequent clicks, it fails to find the string in the  
> field "theText" on the current card, it goes looking for the string  
> on any other card with a field named "theText"
>
> Is there a way to do something like:
>
>     find string tText in field "theText" ON THIS CARD
>
> So that it will not jump to other cards containing a field of the  
> same name and the same text. (Without having to go through the stack  
> and rename fields so that there are no duplicates?)
>
> In short, restrict the search to the current card.
>

Jim Ault
Las Vegas






More information about the use-livecode mailing list