Re: List Words from Textarea
On 10/14/10 12:40 AM, Joe Lewis Wilkins wrote: Jacqi, forgive me for questioning/doubting you, but I really have trouble believing that, what with the literally thousands of scripts I wrote in HC over a period of nearly 20 years. I just don't remember having to strip commas from words when parsing and sorting text. If you say so, but why would Jim have had to point that out if it is the "normal" way of doing things? I guess the mind IS the "first" thing to go. (smile) It's easy to test. Put this in the message box in any version of Rev or MC, as early as you have versions for them: get "However, this is an example." put word 1 of it && last word of it You should see: However, example. I think Jim pointed it out because the OP was new to LiveCode and the behavior isn't intuitive. If you can still run HC, you can test it there too. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: List Words from Textarea
Joe Lewis Wilkins wrote: > Jacqi, forgive me for questioning/doubting you, but I really have > trouble believing that, what with the literally thousands of scripts > I wrote in HC over a period of nearly 20 years. I just don't remember > having to strip commas from words when parsing and sorting text. If > you say so, but why would Jim have had to point that out if it is the > "normal" way of doing things? I guess the mind IS the "first" thing > to go. (smile) One of the difficulties with using HyperCard as a basis for any comparison is that Apple killed it so long ago that it's tied in our memory to the feelings of youth: we forget so much and remember only the good times. :) IIRC, Scott Raney sighed with deep resignation more than a few times at having to implement word delineation using HC rules. Punctuation isn't so bad; it's easy to strip those out as stop characters. More challenging, at least conceptually in some cases, is working with quoted strings, which are treated as a single word no matter how many words are between the quotes. -- Richard Gaskin Fourth World LiveCode training and consulting: http://www.fourthworld.com Webzine for LiveCode developers: http://www.LiveCodeJournal.com LiveCode Journal blog: http://LiveCodejournal.com/blog.irv ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
RE: List Words from Textarea
Thank you guys to all of you for help & sugeestions. The basic idea was to enter on a Textarea some URLs, clicking on a Start Button to open in that application to every 15 seconds every URL from that list. Clicking on a Stop button, to stop that process. First part I've made it with your help, now I have to check how can I open (embedd) an website in the application. Any suggestions? Thank you again. Raz. > From: pepe...@cox.net > Date: Wed, 13 Oct 2010 22:40:05 -0700 > To: use-revolution@lists.runrev.com > Subject: Re: List Words from Textarea > > Jacqi, forgive me for questioning/doubting you, but I really have trouble > believing that, what with the literally thousands of scripts I wrote in HC > over a period of nearly 20 years. I just don't remember having to strip > commas from words when parsing and sorting text. If you say so, but why would > Jim have had to point that out if it is the "normal" way of doing things? I > guess the mind IS the "first" thing to go. (smile) > > Joe Wilkins > > > On Oct 13, 2010, at 10:05 PM, J. Landman Gay wrote: > > > On 10/14/10 12:01 AM, Joe Lewis Wilkins wrote: > >> Hi Jim, > >> > >> Thanks for the info. If this be the case, LC is really screwing > >> around with things that could break MANY applications. I think I'll > >> stay away from LC if this is an example of what is now being done to > >> REV. Who is the crazy loon who decided to do this? VERY > >> un-HyperTalkish! > > > > Actually it's exactly HyperTalkish. It's always been that way, all the way > > back to MetaCard and HyperCard before that. A word includes anything > > between white space, including any punctuation. In fact, I think MC and Rev > > did it that way to maintain compatibility with HC. > > > > -- > > Jacqueline Landman Gay | jac...@hyperactivesw.com > > HyperActive Software | http://www.hyperactivesw.com > > ___ > > use-revolution mailing list > > use-revolution@lists.runrev.com > > Please visit this url to subscribe, unsubscribe and manage your > > subscription preferences: > > http://lists.runrev.com/mailman/listinfo/use-revolution > > ___ > use-revolution mailing list > use-revolution@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: List Words from Textarea
Jacqi, forgive me for questioning/doubting you, but I really have trouble believing that, what with the literally thousands of scripts I wrote in HC over a period of nearly 20 years. I just don't remember having to strip commas from words when parsing and sorting text. If you say so, but why would Jim have had to point that out if it is the "normal" way of doing things? I guess the mind IS the "first" thing to go. (smile) Joe Wilkins On Oct 13, 2010, at 10:05 PM, J. Landman Gay wrote: > On 10/14/10 12:01 AM, Joe Lewis Wilkins wrote: >> Hi Jim, >> >> Thanks for the info. If this be the case, LC is really screwing >> around with things that could break MANY applications. I think I'll >> stay away from LC if this is an example of what is now being done to >> REV. Who is the crazy loon who decided to do this? VERY >> un-HyperTalkish! > > Actually it's exactly HyperTalkish. It's always been that way, all the way > back to MetaCard and HyperCard before that. A word includes anything between > white space, including any punctuation. In fact, I think MC and Rev did it > that way to maintain compatibility with HC. > > -- > Jacqueline Landman Gay | jac...@hyperactivesw.com > HyperActive Software | http://www.hyperactivesw.com > ___ > use-revolution mailing list > use-revolution@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: List Words from Textarea
On 10/14/10 12:01 AM, Joe Lewis Wilkins wrote: Hi Jim, Thanks for the info. If this be the case, LC is really screwing around with things that could break MANY applications. I think I'll stay away from LC if this is an example of what is now being done to REV. Who is the crazy loon who decided to do this? VERY un-HyperTalkish! Actually it's exactly HyperTalkish. It's always been that way, all the way back to MetaCard and HyperCard before that. A word includes anything between white space, including any punctuation. In fact, I think MC and Rev did it that way to maintain compatibility with HC. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: List Words from Textarea
Hi Jim, Thanks for the info. If this be the case, LC is really screwing around with things that could break MANY applications. I think I'll stay away from LC if this is an example of what is now being done to REV. Who is the crazy loon who decided to do this? VERY un-HyperTalkish! Joe Wilkins. On Oct 13, 2010, at 9:17 PM, Jim Ault wrote: > Caution with this solution. > The definition of a 'word' for LiveCode is not what you would normally think. > > Spaces are not the only white space, and punctuation that is attached to the > word is included as part of a word. > > On Oct 13, 2010, at 4:30 PM, Jim Lambert wrote: > >> Razvan wrote: >>> >>> How can I list every word from a textarea? >> >> First, welcome Razvan! >> >> In addition to Pierre"s and Richmond's suggestions, here's a few: >> >> function getWordList someText >> replace space with cr in someText >> return someText >> end getWordList >> >> function getUniqueWordList someText >> repeat for each word w in someText >> if w is not among the lines of uniqueWord then put w & cr after >> uniqueWords >> end repeat >> -- AND JUST FOR THE HECK OF IT >> sort uniqueWords >> return uniqueWords >> end getWordList >> >> Jim Lambert > > Jim Ault > Las Vegas > > > > ___ > use-revolution mailing list > use-revolution@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: List Words from Textarea
Caution with this solution. The definition of a 'word' for LiveCode is not what you would normally think. Spaces are not the only white space, and punctuation that is attached to the word is included as part of a word. On Oct 13, 2010, at 4:30 PM, Jim Lambert wrote: Razvan wrote: How can I list every word from a textarea? First, welcome Razvan! In addition to Pierre"s and Richmond's suggestions, here's a few: function getWordList someText replace space with cr in someText return someText end getWordList function getUniqueWordList someText repeat for each word w in someText if w is not among the lines of uniqueWord then put w & cr after uniqueWords end repeat -- AND JUST FOR THE HECK OF IT sort uniqueWords return uniqueWords end getWordList Jim Lambert Jim Ault Las Vegas ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: List Words from Textarea
Razvan wrote: > > How can I list every word from a textarea? First, welcome Razvan! In addition to Pierre"s and Richmond's suggestions, here's a few: function getWordList someText replace space with cr in someText return someText end getWordList function getUniqueWordList someText repeat for each word w in someText if w is not among the lines of uniqueWord then put w & cr after uniqueWords end repeat -- AND JUST FOR THE HECK OF IT sort uniqueWords return uniqueWords end getWordList Jim Lambert ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: List Words from Textarea
Here's one from the LiveCode Resource Center included in the product (in the RC see Tutorials -> Text ->Listing all the unique words in a piece of text): function uniqueWordsOf theString repeat for each word thisWord in theString add 1 to wordsList[thisWord] -- array variable end repeat return the keys of wordsList -- the list of words end uniqueWordsOf -- Richard Gaskin Fourth World LiveCode training and consulting: http://www.fourthworld.com Webzine for LiveCode developers: http://www.LiveCodeJournal.com LiveCode Journal blog: http://LiveCodejournal.com/blog.irv ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: List Words from Textarea
On 10/13/10 2:27 PM, Richmond wrote: This, along with my way of doing the same thing should show you how flexible LiveCode is, and how there is almost always more than one way to do things. Yup. Only I hate to say it, but Pierre's was much faster. ;) -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: List Words from Textarea
Welcome Raz. Pierre's script gives you one good answer. When I read your email, I assumed you wanted to list each word - but avoid duplicates. To do that, you would change the script slightly, to on mouseup set the wholeMatches to true repeat for each word w in fld "myfield" if w is not among the lines of mywordslist then put w& cr after mywordslist end repeat answer mywordslist end mouseup -- Alex. On 13/10/2010 20:18, Pierre Sahores wrote: Welcome to LiveCode Raz ! on mouseup repeat for each word w in fld "myfield" put w& cr after mywordslist end repeat answer mywordslist end mouseup HTH, Best, Pierre Le 13 oct. 2010 à 21:06, Razvan Pantescu a écrit : I've started to study Livecode, don't know too much of it. I'm living about 250km north of Danube (Focsani, Romania) So any suggestions so I can read or list all the words from a Textarea? Thanks, Raz. Date: Wed, 13 Oct 2010 21:59:55 +0300 From: richmondmathew...@gmail.com To: use-revolution@lists.runrev.com Subject: Re: List Words from Textarea On 10/13/2010 09:57 PM, Razvan Pantescu wrote: Hi, How can I list every word from a textarea? "put any word of field" - show any word, but exists some "every word"? Thank you, Raz. Wow; at least one other LiveCode / RunRev programmer in the Balkans; there's hope yet! How far north of the Danube do you live? sincerely, Richmond Mathewson (Plovdiv, Bulgaria). ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution -- Pierre Sahores mobile : (33) 6 03 95 77 70 www.wrds.com www.sahores-conseil.com ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
RE: List Words from Textarea
Hey Richmond, I wanted to do your version, but I had some issues with sintax. Thank you for your help anyway. Raz. > Date: Wed, 13 Oct 2010 22:27:26 +0300 > From: richmondmathew...@gmail.com > To: use-revolution@lists.runrev.com > Subject: Re: List Words from Textarea > > On 10/13/2010 10:24 PM, Razvan Pantescu wrote: > > Merci Beaucoup Pierre!! > > > > It works fine, > > > > Raz. > > > > > > > > > >> From: psaho...@free.fr > >> Date: Wed, 13 Oct 2010 21:18:37 +0200 > >> To: use-revolution@lists.runrev.com > >> CC: > >> Subject: Re: List Words from Textarea > >> > >> Welcome to LiveCode Raz ! > >> > >> on mouseup > >>repeat for each word w in fld "myfield" > >>put w& cr after mywordslist > >>end repeat > >>answer mywordslist > >> end mouseup > >> > >> HTH, > >> > >> Best, > >> > >> Pierre > >> > >> > >> L > > This, along with my way of doing the same thing should show you how > flexible LiveCode > is, and how there is almost always more than one way to do things. > ___ > use-revolution mailing list > use-revolution@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: List Words from Textarea
On 10/13/2010 10:24 PM, Razvan Pantescu wrote: Merci Beaucoup Pierre!! It works fine, Raz. From: psaho...@free.fr Date: Wed, 13 Oct 2010 21:18:37 +0200 To: use-revolution@lists.runrev.com CC: Subject: Re: List Words from Textarea Welcome to LiveCode Raz ! on mouseup repeat for each word w in fld "myfield" put w& cr after mywordslist end repeat answer mywordslist end mouseup HTH, Best, Pierre L This, along with my way of doing the same thing should show you how flexible LiveCode is, and how there is almost always more than one way to do things. ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: List Words from Textarea
On 10/13/2010 10:06 PM, Razvan Pantescu wrote: I've started to study Livecode, don't know too much of it. I'm living about 250km north of Danube (Focsani, Romania) So any suggestions so I can read or list all the words from a Textarea? I set up a stack with 2 fields: 1. field "targetTEXT" containing the text I wanted to analyse, 2. field "wordList" (a listField). then I made a button with the following script: on mouseUp put the number of words in fld "targetText" into TXNUM repeat with AA = 1 to TXNUM put word AA of fld "targetTEXT" into line AA of fld "wordList" end repeat end mouseUp clicked on the button and "away we go". Richmond. ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
RE: List Words from Textarea
Merci Beaucoup Pierre!! It works fine, Raz. > From: psaho...@free.fr > Date: Wed, 13 Oct 2010 21:18:37 +0200 > To: use-revolution@lists.runrev.com > CC: > Subject: Re: List Words from Textarea > > Welcome to LiveCode Raz ! > > on mouseup > repeat for each word w in fld "myfield" > put w & cr after mywordslist > end repeat > answer mywordslist > end mouseup > > HTH, > > Best, > > Pierre > > > Le 13 oct. 2010 à 21:06, Razvan Pantescu a écrit : > > > > > I've started to study Livecode, don't know too much of it. I'm living about > > 250km north of Danube (Focsani, Romania) > > > > So any suggestions so I can read or list all the words from a Textarea? > > > > > > Thanks, > > Raz. > > > > > > > > > >> Date: Wed, 13 Oct 2010 21:59:55 +0300 > >> From: richmondmathew...@gmail.com > >> To: use-revolution@lists.runrev.com > >> Subject: Re: List Words from Textarea > >> > >> On 10/13/2010 09:57 PM, Razvan Pantescu wrote: > >>> Hi, > >>> > >>> How can I list every word from a textarea? > >>> > >>> "put any word of field" - show any word, but exists some "every word"? > >>> > >>> Thank you, > >>> Raz. > >>> > >>> > >> > >> Wow; at least one other LiveCode / RunRev programmer in the Balkans; > >> there's hope yet! > >> > >> How far north of the Danube do you live? > >> > >> sincerely, Richmond Mathewson (Plovdiv, Bulgaria). > >> ___ > >> use-revolution mailing list > >> use-revolution@lists.runrev.com > >> Please visit this url to subscribe, unsubscribe and manage your > >> subscription preferences: > >> http://lists.runrev.com/mailman/listinfo/use-revolution > > > > ___ > > use-revolution mailing list > > use-revolution@lists.runrev.com > > Please visit this url to subscribe, unsubscribe and manage your > > subscription preferences: > > http://lists.runrev.com/mailman/listinfo/use-revolution > > -- > Pierre Sahores > mobile : (33) 6 03 95 77 70 > > www.wrds.com > www.sahores-conseil.com > > > > > ___ > use-revolution mailing list > use-revolution@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: List Words from Textarea
Welcome to LiveCode Raz ! on mouseup repeat for each word w in fld "myfield" put w & cr after mywordslist end repeat answer mywordslist end mouseup HTH, Best, Pierre Le 13 oct. 2010 à 21:06, Razvan Pantescu a écrit : > > I've started to study Livecode, don't know too much of it. I'm living about > 250km north of Danube (Focsani, Romania) > > So any suggestions so I can read or list all the words from a Textarea? > > > Thanks, > Raz. > > > > >> Date: Wed, 13 Oct 2010 21:59:55 +0300 >> From: richmondmathew...@gmail.com >> To: use-revolution@lists.runrev.com >> Subject: Re: List Words from Textarea >> >> On 10/13/2010 09:57 PM, Razvan Pantescu wrote: >>> Hi, >>> >>> How can I list every word from a textarea? >>> >>> "put any word of field" - show any word, but exists some "every word"? >>> >>> Thank you, >>> Raz. >>> >>> >> >> Wow; at least one other LiveCode / RunRev programmer in the Balkans; >> there's hope yet! >> >> How far north of the Danube do you live? >> >> sincerely, Richmond Mathewson (Plovdiv, Bulgaria). >> ___ >> use-revolution mailing list >> use-revolution@lists.runrev.com >> Please visit this url to subscribe, unsubscribe and manage your subscription >> preferences: >> http://lists.runrev.com/mailman/listinfo/use-revolution > > ___ > use-revolution mailing list > use-revolution@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-revolution -- Pierre Sahores mobile : (33) 6 03 95 77 70 www.wrds.com www.sahores-conseil.com ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
RE: List Words from Textarea
I've started to study Livecode, don't know too much of it. I'm living about 250km north of Danube (Focsani, Romania) So any suggestions so I can read or list all the words from a Textarea? Thanks, Raz. > Date: Wed, 13 Oct 2010 21:59:55 +0300 > From: richmondmathew...@gmail.com > To: use-revolution@lists.runrev.com > Subject: Re: List Words from Textarea > > On 10/13/2010 09:57 PM, Razvan Pantescu wrote: > > Hi, > > > > How can I list every word from a textarea? > > > > "put any word of field" - show any word, but exists some "every word"? > > > > Thank you, > > Raz. > > > > > > Wow; at least one other LiveCode / RunRev programmer in the Balkans; > there's hope yet! > > How far north of the Danube do you live? > > sincerely, Richmond Mathewson (Plovdiv, Bulgaria). > ___ > use-revolution mailing list > use-revolution@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: List Words from Textarea
On 10/13/2010 09:57 PM, Razvan Pantescu wrote: Hi, How can I list every word from a textarea? "put any word of field" - show any word, but exists some "every word"? Thank you, Raz. Wow; at least one other LiveCode / RunRev programmer in the Balkans; there's hope yet! How far north of the Danube do you live? sincerely, Richmond Mathewson (Plovdiv, Bulgaria). ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
List Words from Textarea
Hi, How can I list every word from a textarea? "put any word of field" - show any word, but exists some "every word"? Thank you, Raz. ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution