Page 1 of 1

What's the difference b/n "select line x" and "set the hilitedlines to x"?

Posted: Sat Feb 15, 2025 10:42 am
by MichaelBluejay
I'm able to set the highlighted line of a list field with either of these:

Code: Select all

select line 6 of fid myField
set the hilitedline of old myField to 6
I've searched lo and hi, but can't find the difference between them. Is there one?

BTW, for anyone finding this thread who might be looking for how to programmatically click on a specific line in a list field and have that field fire, I don't think you can do it with one line, but it's pretty easy to do with two:

Code: Select all

select line 6 of fid myField
send mouseup to fid myField

Re: What's the difference b/n "select line x" and "set the hilitedlines to x"?

Posted: Sat Feb 15, 2025 11:36 am
by richmond62
Well, this:

Code: Select all

on mouseUp
   select line 6 of fld "ff"
end mouseUp
works, while this:

Code: Select all

on mouseUp
   set the hilitedlines of fld "ff" to 6
end mouseUp
does nothing.
-
Screenshot 2025-02-15 at 12.33.54.png

Re: What's the difference b/n "select line x" and "set the hilitedlines to x"?

Posted: Sat Feb 15, 2025 11:40 am
by Klaus
From the dictionary about "hilitedline":
...
If the field's listBehavior property is false, this property has no effect.
...
8)

Re: What's the difference b/n "select line x" and "set the hilitedlines to x"?

Posted: Sat Feb 15, 2025 12:40 pm
by MichaelBluejay
Okay, so the answer is that "select line..." always works, and "set the hilitedline..." works only on list fields?

Re: What's the difference b/n "select line x" and "set the hilitedlines to x"?

Posted: Sat Feb 15, 2025 12:41 pm
by Klaus
That's the bottom line. 8)

I always associated "hilitedline(s)" with a listfield and "select(ed) line(s)" with a regular text field.

Re: What's the difference b/n "select line x" and "set the hilitedlines to x"?

Posted: Sat Feb 15, 2025 1:34 pm
by MichaelBluejay
Thank you for the help!

In another thread, Bernd identified another difference: "select line..." screws with the focus, and could "eat" a user's subsequent click, causing it to not register. Switching from "select line..." to "select the hilitedline..." fixed that problem in my stack.