Remove selected line from a list field

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
wake
Posts: 21
Joined: Thu Jun 25, 2009 6:15 pm

Remove selected line from a list field

Post by wake » Thu Jun 25, 2009 6:18 pm

Simple problem, but not having luck with a solution.

I am trying to remove the selected line from a list field.
Any help would be great.

Thanks in advance!

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

Post by Klaus » Thu Jun 25, 2009 6:35 pm

Hi Wake,

do this:
...
put the hilitedlines of fld "your list field" into line2Bdeleted
## Always a good idea to doublecheck!
if line2Bdeleted <> empty then
delete line line2Bdeleted of fld "your list field"
end if
...

See "hilitedlines" and "selectedtext" (in case you once need the text that is hilited :)) in the docs.


Best from germany

Klaus

wake
Posts: 21
Joined: Thu Jun 25, 2009 6:15 pm

Post by wake » Thu Jun 25, 2009 6:42 pm

Klaus thanks so much! I will give this a try.

It is amazing how difficult it can be to think in terms of plain English when you have been coding in other languages for so long.

This seems like a pretty neat language though.

Edit:
This worked like a charm.
Thanks again!

Post Reply