filter list help

Alex Tweedly alex at tweedly.net
Mon Jan 10 17:08:45 EST 2005


Bob Hartley wrote:

> Hi Alex
>
> This filters great but creates a problem.
> In the listfield I had the script
> on mouseDoubleUp
>    if the hilitedLine is not empty then
>       go card (the hilitedLine of me)
>    end if
> end mouseDoubleUp
>
> This would allow the user to double click on an entry to go to the 
> card corresponding to the ListField entry.
>
> However, after filtering it does not go to the card on double click.
>
> Any Ideas? I'm assuming the filtering removes the text association 
> with hte card somehow....


Yes, I think it does, indirectly.

"the hilitedLine" gives the line number of the selected line within the 
field - so basically what you are doing is requiring that the lines of 
the list are in corresponding order with the cards.

You might be better to either name the cards to match the list items, or 
to have a variable (customProperty ?) which contains ALL the item names 
and the corresponding card numbers (or names). Then you could use the 
selectedText (or the chunk expression for the line) to select the 
relevant entry.

Say ,

(somewhere in initialization code)
-- Store all command names in card order
set the cCommandNames to "Scale,Other,Descale,Descaled,etc."

and in the listfield
on mouseDoubleUp
   if the hilitedLine is not empty then
      put the hilitedLine of me into myVar
      put itemOffset(myVar, sCommandNames) into tCardNumber
      if tCardNumber > 0 then   go card tCardNumber
   end if
end mouseDoubleUp




-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.6.9 - Release Date: 06/01/2005



More information about the use-livecode mailing list