Using an index field

Sarah Reichelt sarahr at genesearch.com.au
Wed Jan 26 23:17:24 EST 2005


> Thanks for the reply.  The contents are a single field.  There's only 
> one card, and the index field and contents field are about all there 
> is.  Just a title and a 'put away' button.  The script for the index 
> field is:
>
> on mouseup
>   put the value of the clickline into tFindText
>   if  tFindText contains "overview" then find "overview" in fld 
> "contents"
>   else find whole tFindText in fld "contents"
> end mouseup
>
> The index is generated by hand.  It's not a big deal, but when the 
> last foundchunk (or line) is somewhere in the middle or near the 
> bottom and a line in the index field that is above the last one is 
> clicked, nothing happens.  It takes a second click for it to do 
> anything.  I was hoping there was a tip someone could offer to script 
> around that.
> Dave
>
When you do a find, rev puts a box around the found text. if you then 
do "find empty" it gets rids of the box and resets the find position. I 
think this might be the workaround you are looking for.

Alternatively, consider using lineOffset to get the relevant line 
number and then set the vScroll of the field to the number of the line 
* the textHeight.

Cheers,
Sarah



More information about the use-livecode mailing list