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

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
MichaelBluejay
Posts: 230
Joined: Thu Jul 01, 2010 11:50 am

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

Post by MichaelBluejay » Sat Feb 15, 2025 10:42 am

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

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10078
Joined: Fri Feb 19, 2010 10:17 am

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

Post by richmond62 » Sat Feb 15, 2025 11:36 am

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
Attachments
selected.livecode.zip
Stack.
(1.02 KiB) Downloaded 261 times

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

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

Post by Klaus » Sat Feb 15, 2025 11:40 am

From the dictionary about "hilitedline":
...
If the field's listBehavior property is false, this property has no effect.
...
8)

MichaelBluejay
Posts: 230
Joined: Thu Jul 01, 2010 11:50 am

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

Post by MichaelBluejay » Sat Feb 15, 2025 12:40 pm

Okay, so the answer is that "select line..." always works, and "set the hilitedline..." works only on list fields?

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

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

Post by Klaus » Sat Feb 15, 2025 12:41 pm

That's the bottom line. 8)

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

MichaelBluejay
Posts: 230
Joined: Thu Jul 01, 2010 11:50 am

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

Post by MichaelBluejay » Sat Feb 15, 2025 1:34 pm

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.

Post Reply