struggle to use lineoffset
DVGlasgow at aol.com
DVGlasgow at aol.com
Mon Jan 6 06:19:09 EST 2003
In a message dated 5/1/03 1:29:22 AM, Jan Schenkel. writes:
<< In this case, wouldn't it be easier to keep track of
the linenumber you're checking, instead of using
lineoffset to go through the entire text every time?
on mouseup
get the selectedtext of me
put char 1 to 3 of word 5 of it into tcat
put 0 into j
repeat for each line i in me
add 1 to j
if i contains tcat then select line j of me
end repeat
end mouseup
Back to lineOffset now: if some lines are very much
alike one another, you may want to
set the wholeMatches to true
before using lineOffset, to make sure you have the
correct line. >>
Thanks Jan!
Your script goes straight in the old note book. I have always just accepted
that the repeat for each structure didn't have a count built in - how obvious
that you can script one.
And thanks for the tip on lineoffset. I discovered I needed set the
hilitedline of me to empty just before the loop, or the line first clicked
was the only one in the category that was unhilited.
The other interesting thing is the script *appears* to work, but actually
doesn't! The hilites disappear (apart from the original) as soon as the
scrollbar is moved. it also doesn't reliably hilite all instances if the
field is sorted by any chunk other than the one containing the category. I
have switched the toggle hilites property a couple of times, but it doesn't
fix it.
Richard Gaskin's method produces stable noncontiguous hilites (Thanks once
again), but of course it only works the firt time through. I hadn't
considered how I was going to unhilite the lines second and third time
through. Maybe this shouldn't be a mouseup thing, doublemouseup would leave
mouseup to select a single line and clear the multiple
selections.........hmmmm. And so it goes....
If anyone else has chipped in, I have only read the above so far, so TIA of
the usual multiple replies.
Best wishes,
David Glasgow
Home/ forensic assessments --> <A HREF="http://members.aol.com/dvglasgow/">
DVGlasgow </A>
Courses --> <A HREF="http://www.i-Psych.co.uk">i-Psych</A>
More information about the use-livecode
mailing list