select text in a field by line number

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
churchken
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 66
Joined: Sun Apr 15, 2007 2:54 pm

select text in a field by line number

Post by churchken » Wed Dec 23, 2009 1:57 pm

Hi,

I'm befuddled -- not an uncommon situation for me :)

If a field contains 500 lines of text, and lines 1 to 25 should be deleted from that field, is there a quick way to "select" those lines as a "chunk" and empty them? I'd like to "hilite" that group of lines without the user needing to use the mouse to do so and then delete them.

It seems some combination of "the selection" and "hilitedLIne" should work, but I'm not figuring it out. Thanks in advance for any help.

Regards,
Ken

oliverk
Site Admin
Site Admin
Posts: 53
Joined: Mon Feb 27, 2006 2:16 pm

Re: select text in a field by line number

Post by oliverk » Wed Dec 23, 2009 2:54 pm

Hi Ken,

If you just want to delete the text, you can just do something like:

Code: Select all

delete line 1 to 25 of field "MyField"
But maybe you are trying to do something more complicated?

Regards
Oliver
Oliver Kenyon
Software Developer
Runtime Revolution

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Re: select text in a field by line number

Post by dunbarx » Wed Dec 23, 2009 3:50 pm

As Oliver says, deleting is simple.

But I think you are asking for a nice way to select a certain block of lines (which may not be contiguous?). Such a process would be simple and fun to write, and there are a million ways to do it. And you do not want to use the mouse, which I can understand if you have a long list

Is there a certain criterion that distinguishes the lines to go on the block? A date or something in the text of the lines themselves? Write back with a bit more info as to your ideal way to do it.

Post Reply