How to select 1 to 7 chars after find command??

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
Fasasoftware
Posts: 203
Joined: Mon Oct 31, 2011 9:36 pm
Contact:

How to select 1 to 7 chars after find command??

Post by Fasasoftware » Sun Jan 13, 2013 9:27 pm

Dear friend,

How to select 1 to 7 chars after "find" command??

i would like to select the first 7 char after a find command and put it into a field....in other words take the right end of a word founded with find command...and put them into a field.....

I thank you in advance,

Best regards,

lestroso :oops:

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: How to select 1 to 7 chars after find command??

Post by jmburnod » Sun Jan 13, 2013 9:34 pm

Hi Fasasoftware
Have a look to "foundChunk" in the LC dictionary
Best regards
Jean-Marc
https://alternatic.ch

Fasasoftware
Posts: 203
Joined: Mon Oct 31, 2011 9:36 pm
Contact:

Re: How to select 1 to 7 chars after find command??

Post by Fasasoftware » Mon Jan 14, 2013 12:41 pm

hi jmburnod,

can you or other tell me a simple script to use foundchunk function???to select a 7 chars after a find command... for example: "pippo play with me"....and i need for example .... find"pippo" and then select the chars "play"....i thank you so much...


best regards,
lestroso :oops:

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: How to select 1 to 7 chars after find command??

Post by jmburnod » Mon Jan 14, 2013 2:57 pm

Hi Lestroso,

I'm not sur the find command is the best way to do that, but it s possible

Code: Select all

on mouseUp
   find "pippo" in fld 1
   put  the foundchunk into tFC
   find ""
   put word 4 of tFC into tEnd
   put char tEnd +2 to 30 of fld 1 into tCont
   put offset(" ",tCont) into tEndWord
   select char (tEnd +2) to (tEnd + tEndWord) of fld 1
   put tEnd && tEndWord && tCont
end mouseUp
You can use also wordoffset like this:

Code: Select all

on mouseUp
   put wordoffset("pippo", fld 1 ) into tOffW
   select word tOffW +1 of fld 1
end mouseUp
Best regards
Jean-Marc
https://alternatic.ch

Fasasoftware
Posts: 203
Joined: Mon Oct 31, 2011 9:36 pm
Contact:

Re: How to select 1 to 7 chars after find command??

Post by Fasasoftware » Mon Jan 14, 2013 5:53 pm

MANY Thousands Thanks!!!!!!

Thanks a lot Jean-Marc!!! You helped me a lot......There's no word to thank you....

I have tryed your example...but the second...but also powerful....because more simple and easy to understand for me....ok now i will implement this in my android app....hoping that this willl work.....

Best regards,

Lestroso :D :D :D

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: How to select 1 to 7 chars after find command??

Post by jmburnod » Mon Jan 14, 2013 11:16 pm

Hi Lestroso,
.hoping that this willl work.....
I hope too and if not I'm sur somebody have a solution
All the best
Jean-Marc
https://alternatic.ch

Post Reply