Using an index field
dsquance at elkvalley.net
Wed Jan 26 21:56:35 CST 2005
On Jan 26, 2005, at 2:17 PM, Richard Gaskin wrote:
> David Squance wrote:
>> I've built a help stack for an app which consists mostly of two
>> fields, one the content and the other an index. Clicking on a line
>> in the index takes the user to the appropriate section of the help
>> contents. It works fine when going 'down' the contents, but I'm
>> wondering if there is a simple way for the user to avoid having to
>> click twice to access any section which occurs earlier in the content
>> than where the last found line occurs.
> I'n not sure how you code is setup, but I use a similar layout and
> very simple supporting code.
> To fill the index list I just use:
> put the cardnames of this stack into fld "index"
> To go to a card I have this in the "index" field script:
> on mouseUp
> go cd (the hilitedLine of me)
> end mouseUp
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
put the value of the clickline into tFindText
if tFindText contains "overview" then find "overview" in fld
else find whole tFindText in fld "contents"
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.
More information about the use-livecode