An specific text selection

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
alemrantareq
Posts: 203
Joined: Wed Jul 23, 2008 8:46 am

An specific text selection

Post by alemrantareq » Sat Feb 13, 2010 1:35 pm

I've a scrolling field with some texts, a option button and a normal button. I need to verify whether the selected item from option button matches with the texts of the field; and I successfully did that using lineoffset function. At first, I put the selected item into a global variable and then I use it to lineoffset function to verify the matches through the normal button script.

Now I want to select and delete the text in the field which matches with the selected item of option button, but I can't make the script. Someone pls help me to do that.........Thanks in advance

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

Re: An specific text selection

Post by bn » Mon Feb 15, 2010 12:18 pm

Hi alemrantareq,
from what I understand you have already everything in place to delete the line in the text field.
Once you have found the lineoffset in the textfield just say delete line xyz of field "myTextField".
Or is this not what you want?
regards
Bernd

alemrantareq
Posts: 203
Joined: Wed Jul 23, 2008 8:46 am

Re: An specific text selection

Post by alemrantareq » Tue Feb 23, 2010 9:05 pm

Thanks Bernd for reply, I know how to delete the line but I don't know how to select the line that matches with the selection of option btn. :?

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

Re: An specific text selection

Post by bn » Thu Feb 25, 2010 1:55 pm

Alemrantareq,
alemrantareq wrote:I've a scrolling field with some texts, a option button and a normal button. I need to verify whether the selected item from option button matches with the texts of the field; and I successfully did that using lineoffset function. At first, I put the selected item into a global variable and then I use it to lineoffset function to verify the matches through the normal button script.

Now I want to select and delete the text in the field which matches with the selected item of option button, but I can't make the script. Someone pls help me to do that.........Thanks in advance
So you have the line number:
just say

Code: Select all

select line x of field "xyz"
where you already have the line number from the lineoffset.
or say

Code: Select all

delete line x of field "xyz"
Or I dont understand what you want.
regards
Bernd

Post Reply