Help with drill-down script

J. Landman Gay jacque at hyperactivesw.com
Mon Jun 21 13:49:22 EDT 2010


Emmett Gray wrote:

> Anyway, there's one feature: the first card is an index of all the cards 
> in the stack. In HC, all you need to do is start typing and as you add 
> letters, the selected line changes to reflect what you've typed. When 
> you get to what you want, you hit return and that takes you to the 
> respective card.

I didn't read through your whole script, but here is a skeleton outline 
of one way to handle the behavior, you can adjust it for whatever else 
you need to do:


local lUserKeys, lOldTicks

on keyDown  whichKey -- select from keyboard
   if (the selectedField is not "") or (charToNum(whichKey) is among the 
items of "28,29,30,31") -- arrow keys
   then pass keyDown
   if the ticks - lOldTicks > 60 then put "" into lUserKeys -- adjust 
time here
   put whichKey after lUserKeys
   put return & fld activeFld & return into tListText
   get lineoffset(cr&lUserKeys,tListText)
   if it > 0 then set the hilitedline of fld activeFld to it
   put the ticks into lOldTicks
end keyDown

Note the user of a local script variable outside the handler 
declaration, rather than a global.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list