ListBehavior, multipleHilite, nonContiquousHilite & toggleHilites.
This code returns a list of hilited line numbers.
Code: Select all
put the HilitedLines of fld "my.list" into my.variable
Now here's my problem. I need to know when the user selects a new line.
I don't care when the user un-selects. Just when a new line is added.
But the above code only reports the entire list of lines.
So I wrote a little function where I pass the list before and after each click.
But now I'm thinking there might be a simpler way. This code works fine,
but I just can't resist asking, is there a better way to do this?
I pass in two values like: "2,6,11" and "2,6,8,11" and it returns 8.
Code: Select all
function last.click before.click, after.click
local bigger, smaller, temp, the.answer
if number of items in after.click > number of items in before.click then
repeat with ii=1 to number of items in before.click
put item ii of before.click into temp
if temp is in after.click then
if temp & comma is in after.click then
replace temp & comma with empty in after.click
else
replace temp with empty in after.click
end if
end if
end repeat
replace comma with empty in after.click
return after.click
else
return empty
end if
end last.click