Can I retrieve non-contiguous selected lines from ListField?

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
BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Can I retrieve non-contiguous selected lines from ListField?

Post by BarrySumpter » Mon Feb 20, 2012 7:39 am

Hi all,

I have 2000 vids I want to make a playlist from.

If I drag n drop say 37 files into a a livecode textfield
I than want to select all the .mov or all the .avi with a single button
Or multiselect all the movies I consider action movies.
Then I want to do something with just those selected lines etc.

I'm absolutely sure I've covered this topic before but I can't find my post about retrieving only the select lines from a textfield
And processing them one line at a time.
This project looks huge for such a simple task.
is there an easier way?
i.e. the brilliant way livecode handles text chunks, etc.

21204-shifting-selected-text-to-the-right-or-left
http://lessons.runrev.com/s/lessons/m/2 ... ht-or-left

Also, I can't seem to select non-contiguous lines in a textField. Is this possible?

Many thanks in advance
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Re: Can I retrieve non-contiguous selected lines from ListFi

Post by BarrySumpter » Mon Feb 20, 2012 7:44 am

Code: Select all

      repeat with x = 1 to number of items in the hilitedLines of field field0  
         put return after str1
         put item x in the hilitedLines of field field0 into selectedLineNumber
         put x & ": " & line  selectedLineNumber of field field0 after str1
      end repeat
--
      set the text of field Field1 to str1
Anyone know how to set the properties of a ListField to allow selection of non-contiguous lines?
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: Can I retrieve non-contiguous selected lines from ListFi

Post by bn » Mon Feb 20, 2012 9:22 am

Hi Barry,

you can turn on non-contiguous in the properties inspector for the list field. Multiple lines option also has to be checked.

Code: Select all

put the selectedText of field 1
gives you a list of the selectedText, one line for each selected line.

Kind regards

Bernd

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Re: Can I retrieve non-contiguous selected lines from ListFi

Post by BarrySumpter » Mon Feb 20, 2012 9:58 am

Blast.

Am I getting my TextFields and ListFields mixed up?

Can't seem to get the Text Field to select non-contiguous lines.

Or is it the drag n drop that I'm not setting up properly?
Or is it MAC OS X Lion?

ListBehaviour ticked on
MultipleHighlights ticked on
non-contiguous ticked on
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: Can I retrieve non-contiguous selected lines from ListFi

Post by bn » Mon Feb 20, 2012 10:07 am

Hi Barry,

I probably don't quite understand what you want.

if you want to set the hilitedLines by script in a list field with
ListBehaviour ticked on
MultipleHighlights ticked on
non-contiguous ticked on

then you can set them

Code: Select all

on mouseUp
   put "1,4,7" into tToHilite
   set the hilitedLines of field 1 to tToHilite
end mouseUp
if that is not it then please explain again what is not working.

Kind regards

Bernd

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Re: Can I retrieve non-contiguous selected lines from ListFi

Post by BarrySumpter » Mon Feb 20, 2012 10:11 am

OK thanks Bernd.

LOL.
It was me.
Surprise, Surprise, Surprise!

MAC OS X is not my native development environment.
Fumbling around on the MAC Book Pro keyboard was driving me crazy.
So using logmein to control my macbookpro,
I found the apple command button to be the Windows Start button on my MS Natural Multimedia keyboard.
:oops:

It looks like the textbox does NOT have the ListBehaviour ticked on.
And the ListBox is just a textbox which has the ListBehaviour ticked on.
The text chunk works the same way on both I would deduce.

Somethings as simple as that makes me doubt everything.
It doesn't have to be this hard.
I'll be kicking meself for a while.
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

Post Reply