Re: [WebDNA] GETCHARS ... words?

This WebDNA talk-list message is from

2009


It keeps the original formatting.
numero = 102280
interpreted = N
texte = That's great! So much for all that other fancy #$@% I've used in the past !! Regards Stuart Tremain IDFK Web Developments AUSTRALIA webdna@idfk.com.au On 28/03/2009, at 4:17 AM, Brian Fries wrote: > The most efficient code I've found for this is: > > [text]shortstring=[middle endbefore= ][getchars start=1&end=1000] > [sourcestring][/getchars][/middle][/text] > > Brian Fries > BrainScan Software > > > On Mar 26, 2009, at 2:04 PM, Toby Cox wrote: > >> I looked into the different ways of doing this a while back and was >> surprised by the results: >> >> To my mind there are 3 ways of doing it >> >> 1. The way Steve has described >> >> 2. Guessing how many words are in 1000 characters and doing a plain >> listwords >> >> 3. Using FindString to pull out the last space from the first 1,000 >> characters >> >> >> A while back I did speed tests on this and was surprised by results >> >> Working on 8,000 characters on our servers option 1 takes 0.02 >> secs, option 2 takes 0.35 secs and option 3 takes 0.00 >> >> >> Code here >> >> >> [text]mystring=[url]...Insert enormous string here...[/url][/text] >> [math show=f]time3=[ELAPSEDTIME][/math] >> [if [countchars][mystring][/countchars]>1000] >> [then] >> [listwords delimiters= &words=[unurl][getchars start=1&end=1000] >> [mystring][/getchars][/unurl]][text]word[math][index]+1[/ >> math]=[word][/text][text]word[index][/text] [/listwords]... >> [/then] >> [else] >> [mystring] >> [/else] >> [/if]

>> [math show=f]time4=[ELAPSEDTIME][/math]** Countchars with listwords >> took [format .2f][math]([time4]-[time3])/60[/math][/format] seconds >> ** >>
>> [math show=f]time1=[ELAPSEDTIME][/math] >> [listwords words=[mystring]][showif [index]<100][word] [/showif][/ >> listwords] >>
>> [math show=f]time2=[ELAPSEDTIME][/math]** Guessing how many >> characters are in 1,000 chars took [format .2f][math]([time2]- >> [time1])/60[/math][/format] seconds ** >>


>> >> [math show=f]time1=[ELAPSEDTIME][/math] >> [text]foundatstring=[getchars start=980&end=1000][mystring][/ >> getchars][/text] >> [text]foundat=[findstring Source=[foundatstring]&Find= >> %20&StartAt=1&reverse=T][/text] >> [unurl][getchars start=1&end=[math]1000-[foundat]-2[/math]] >> [mystring][/getchars][/unurl]

>>

>> [math show=f]time2=[ELAPSEDTIME][/math]** Using FindString to find >> a space in text takes [format .2f][math]([time2]-[time1])/60[/math] >> [/format] seconds ** >> >>
>> >> >> On 26 Mar 2009, at 20:36, Steve Craig wrote: >> >>> Hi >>> >>> I have used this for a while now and it works fine for me. >>> >>> [if [countchars][myMAINSTORY][/countchars]>1000] >>> [then] >>> [listwords delimiters= &words=[url][getchars start=1&end=1000] >>> [myMAINSTORY][/getchars][/url]][text]word[math][index]+1[/ >>> math]=[word][/text][text]word[index][/text] [/listwords]... >>> [/then] >>> [else] >>> [myMAINSTORY] >>> [/else] >>> [/if] >>> >>> The listwords line should be all in one if this email wraps. Hope >>> this helps. >>> >>> Cheers >>> ======================================== >>> Steve Craig - Asylum Interactive Ltd >>> Tel +44 1330 860550 Fax +44 1330 860880 >>> ======================================== >>> http://www.asylumweb.com >>> Email: steve@asylumweb.com >>> Skype: s.craig - iChat: steve.craig >>> ======================================== >>> >>> >>> >>> >>> On 26 Mar 2009, at 19:54, Ki Song wrote: >>> >>>> Is there a function within WebDNA that allows you to limit the >>>> number >>>> of characters, but on get complete words? >>>> For example, we would like to first 1000 characters from a field. >>>> However, if character 1000 is in the middle of a word, it would >>>> only >>>> return the last full word before the 1000th character. >>>> >>>> Does that make sense? >>>> Is this possible? >>>> >>>> ----------- >>>> Ki Song >>>> --------------------------------------------------------- >>>> This message is sent to you because you are subscribed to >>>> the mailing list . >>>> To unsubscribe, E-mail to: >>>> archives: http://mail.webdna.us/list/talk@webdna.us >>>> old archives: http://dev.webdna.us/TalkListArchive/ >>> >>> >>> --------------------------------------------------------- >>> This message is sent to you because you are subscribed to >>> the mailing list . >>> To unsubscribe, E-mail to: >>> archives: http://mail.webdna.us/list/talk@webdna.us >>> old archives: http://dev.webdna.us/TalkListArchive/ >> >> --------------------------------------------------------- >> This message is sent to you because you are subscribed to >> the mailing list . >> To unsubscribe, E-mail to: >> archives: http://mail.webdna.us/list/talk@webdna.us >> old archives: http://dev.webdna.us/TalkListArchive/ > > --------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us > old archives: http://dev.webdna.us/TalkListArchive/ Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] GETCHARS ... words? (Stuart Tremain 2009)
  2. Re: [WebDNA] GETCHARS ... words? (Patrick McCormick 2009)
  3. Re: [WebDNA] GETCHARS ... words? (Toby Cox 2009)
  4. Re: [WebDNA] GETCHARS ... words? (Brian Fries 2009)
  5. Re: [WebDNA] GETCHARS ... words? (Toby Cox 2009)
  6. Re: [WebDNA] GETCHARS ... words? (Steve Craig 2009)
  7. Re: [WebDNA] GETCHARS ... words? (Donovan Brooke 2009)
  8. [WebDNA] GETCHARS ... words? (Ki Song 2009)
That's great! So much for all that other fancy #$@% I've used in the past !! Regards Stuart Tremain IDFK Web Developments AUSTRALIA webdna@idfk.com.au On 28/03/2009, at 4:17 AM, Brian Fries wrote: > The most efficient code I've found for this is: > > [text]shortstring=[middle endbefore= ][getchars start=1&end=1000] > [sourcestring][/getchars][/middle][/text] > > Brian Fries > BrainScan Software > > > On Mar 26, 2009, at 2:04 PM, Toby Cox wrote: > >> I looked into the different ways of doing this a while back and was >> surprised by the results: >> >> To my mind there are 3 ways of doing it >> >> 1. The way Steve has described >> >> 2. Guessing how many words are in 1000 characters and doing a plain >> listwords >> >> 3. Using FindString to pull out the last space from the first 1,000 >> characters >> >> >> A while back I did speed tests on this and was surprised by results >> >> Working on 8,000 characters on our servers option 1 takes 0.02 >> secs, option 2 takes 0.35 secs and option 3 takes 0.00 >> >> >> Code here >> >> >> [text]mystring=[url]...Insert enormous string here...[/url][/text] >> [math show=f]time3=[elapsedtime][/math] >> [if [countchars][mystring][/countchars]>1000] >> [then] >> [listwords delimiters= &words=[unurl][getchars start=1&end=1000] >> [mystring][/getchars][/unurl]][text]word[math][index]+1[/ >> math]=[word][/text][text]word[index][/text] [/listwords]... >> [/then] >> [else] >> [mystring] >> [/else] >> [/if]

>> [math show=f]time4=[elapsedtime][/math]** Countchars with listwords >> took [format .2f][math]([time4]-[time3])/60[/math][/format] seconds >> ** >>
>> [math show=f]time1=[elapsedtime][/math] >> [listwords words=[mystring]][showif [index]<100][word] [/showif][/ >> listwords] >>
>> [math show=f]time2=[elapsedtime][/math]** Guessing how many >> characters are in 1,000 chars took [format .2f][math]([time2]- >> [time1])/60[/math][/format] seconds ** >>


>> >> [math show=f]time1=[elapsedtime][/math] >> [text]foundatstring=[getchars start=980&end=1000][mystring][/ >> getchars][/text] >> [text]foundat=[findstring Source=[foundatstring]&Find= >> %20&StartAt=1&reverse=T][/text] >> [unurl][getchars start=1&end=[math]1000-[foundat]-2[/math]] >> [mystring][/getchars][/unurl]

>>

>> [math show=f]time2=[elapsedtime][/math]** Using FindString to find >> a space in text takes [format .2f][math]([time2]-[time1])/60[/math] >> [/format] seconds ** >> >>
>> >> >> On 26 Mar 2009, at 20:36, Steve Craig wrote: >> >>> Hi >>> >>> I have used this for a while now and it works fine for me. >>> >>> [if [countchars][myMAINSTORY][/countchars]>1000] >>> [then] >>> [listwords delimiters= &words=[url][getchars start=1&end=1000] >>> [myMAINSTORY][/getchars][/url]][text]word[math][index]+1[/ >>> math]=[word][/text][text]word[index][/text] [/listwords]... >>> [/then] >>> [else] >>> [myMAINSTORY] >>> [/else] >>> [/if] >>> >>> The listwords line should be all in one if this email wraps. Hope >>> this helps. >>> >>> Cheers >>> ======================================== >>> Steve Craig - Asylum Interactive Ltd >>> Tel +44 1330 860550 Fax +44 1330 860880 >>> ======================================== >>> http://www.asylumweb.com >>> Email: steve@asylumweb.com >>> Skype: s.craig - iChat: steve.craig >>> ======================================== >>> >>> >>> >>> >>> On 26 Mar 2009, at 19:54, Ki Song wrote: >>> >>>> Is there a function within WebDNA that allows you to limit the >>>> number >>>> of characters, but on get complete words? >>>> For example, we would like to first 1000 characters from a field. >>>> However, if character 1000 is in the middle of a word, it would >>>> only >>>> return the last full word before the 1000th character. >>>> >>>> Does that make sense? >>>> Is this possible? >>>> >>>> ----------- >>>> Ki Song >>>> --------------------------------------------------------- >>>> This message is sent to you because you are subscribed to >>>> the mailing list . >>>> To unsubscribe, E-mail to: >>>> archives: http://mail.webdna.us/list/talk@webdna.us >>>> old archives: http://dev.webdna.us/TalkListArchive/ >>> >>> >>> --------------------------------------------------------- >>> This message is sent to you because you are subscribed to >>> the mailing list . >>> To unsubscribe, E-mail to: >>> archives: http://mail.webdna.us/list/talk@webdna.us >>> old archives: http://dev.webdna.us/TalkListArchive/ >> >> --------------------------------------------------------- >> This message is sent to you because you are subscribed to >> the mailing list . >> To unsubscribe, E-mail to: >> archives: http://mail.webdna.us/list/talk@webdna.us >> old archives: http://dev.webdna.us/TalkListArchive/ > > --------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us > old archives: http://dev.webdna.us/TalkListArchive/ Stuart Tremain

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Emailer error (1998) Unauthorized User trouble (1998) creator code (1997) TCP Connect for a newbie (2002) Database Options (1997) [BoldWords] WebCat.acgib15Mac (1997) RE: Credit Card not accepted (1998) Extended [ConvertChars] (1997) Thanks Aaron (2000) Searching in multiple databases from a form (1999) Bad card db - *mislabled post* (1999) Format 1.15 to 1:15:00 or 01:15:00 (2002) Orderfile (2005) WebCat2b14MacPlugIn - [include] doesn't hide the search string (1997) TCPConnect / Current Temperature (2004) WebCat2 - [include] tags (1997) Extended [ConvertChars] (1997) WebCatalog Technical Reference (1997) Multiple catalog databases and showcart (1997) [AppendFile] problem (WebCat2b13 Mac .acgi) (1997)