Re: [WebDNA] How to stop cutting a word

This WebDNA talk-list message is from

2008


It keeps the original formatting.
numero = 100223
interpreted = N
texte = Untested, but I would just keep a running tally until you hit your limit. If [break] works inside [listwords], then put a hideif containing a [break] before your showif. Then it would act like a Do...Until loop. [text show=f]strText=Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.[/text] [math show=f]intCutOff=220[/math] [math show=f]intCount=0[/math] [text show=f]txtShort=[/text] [listwords words=[strText]&delimiters=] [showif [intCount]<[intCutOff]] [text show=f]txtShort=[hideif [txtShort]=][txtShort] [/hideif][word][/text] [math show=f]intCount=[intCount]+[countchars][word][/countchars][/math] [/showif] [/listwords] [txtShort] Matthew Bohne Charles Kline wrote: > [text show=f]BODY=MacBook Air takes laurels in three-way usability > competition Of three ultrathin portables - MacBook Air, Toshiba > Portege, and Lenovo ThinkPad - which is the most usable? To find out, > Computerworld turned to usability experts and 20 impartial testers. > Those testers, David Haskin relates, found MacBook Air the most > usable, the most fun, and the best value of the three. In fact, they > made MacBook Air "the clear winner when asked which laptop they'd > purchase." Pro Tip of the Week: Become a Spaces Cadet When open > windows start piling up on your desktop, Mac OS X Leopard provides a > great way to establish control. Spaces. How can Spaces help you get > more organized? Find out by reading the latest Pro Tip of the > Week.[/text] > > [GETCHARS > start=1&end=200&trim=both][REMOVEHTML][Body][/REMOVEHTML][/GETCHARS] > > > Returns: > > MacBook Air takes laurels in three-way usability competition Of three > ultrathin portables - MacBook Air, Toshiba Portege, and Lenovo > ThinkPad - which is the most usable? To find out, Computerworld tur > > I think you are just getting lucky :) > > > - Charles > > On Jul 3, 2008, at 9:16 AM, Frank Nordberg wrote: > >> Stuart Tremain wrote: >> >>> It is meant to cut off a block of text between char 220 to 260 but >>> only at a space, ie not cutting a word in half >> >> This is the code I use for a similar purpose: >> >> [GETCHARS >> start=1&end=200&trim=both][REMOVEHTML][Body][/REMOVEHTML][/GETCHARS] >> >> It seems to work fine but looking at it now, I can't understand why. >> According to the WebDNA documentation the "trim=both" parameter only >> removes spaces that may have ended up at the beginning or end of the >> string but it apparently it's much more useful than that, removing >> incomplete words from the ends of the string as well. >> > > > > Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] How to stop cutting a word ("William DeVaul" 2008)
  2. Re: [WebDNA] How to stop cutting a word (Matthew Bohne 2008)
  3. Re: [WebDNA] How to stop cutting a word (Frank Nordberg 2008)
  4. Re: [WebDNA] How to stop cutting a word (Frank Nordberg 2008)
  5. Re: [WebDNA] How to stop cutting a word (Charles Kline 2008)
  6. Re: [WebDNA] How to stop cutting a word (Stuart Tremain 2008)
  7. Re: [WebDNA] How to stop cutting a word (Frank Nordberg 2008)
  8. [WebDNA] How to stop cutting a word (Stuart Tremain 2008)
Untested, but I would just keep a running tally until you hit your limit. If [break] works inside [listwords], then put a hideif containing a [break] before your showif. Then it would act like a Do...Until loop. [text show=f]strText=Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.[/text] [math show=f]intCutOff=220[/math] [math show=f]intCount=0[/math] [text show=f]txtShort=[/text] [listwords words=[strText]&delimiters=] [showif [intCount]<[intCutOff]] [text show=f]txtShort=[hideif [txtShort]=][txtShort] [/hideif][word][/text] [math show=f]intCount=[intCount]+[countchars][word][/countchars][/math] [/showif] [/listwords] [txtShort] Matthew Bohne Charles Kline wrote: > [text show=f]BODY=MacBook Air takes laurels in three-way usability > competition Of three ultrathin portables - MacBook Air, Toshiba > Portege, and Lenovo ThinkPad - which is the most usable? To find out, > Computerworld turned to usability experts and 20 impartial testers. > Those testers, David Haskin relates, found MacBook Air the most > usable, the most fun, and the best value of the three. In fact, they > made MacBook Air "the clear winner when asked which laptop they'd > purchase." Pro Tip of the Week: Become a Spaces Cadet When open > windows start piling up on your desktop, Mac OS X Leopard provides a > great way to establish control. Spaces. How can Spaces help you get > more organized? Find out by reading the latest Pro Tip of the > Week.[/text] > > [GETCHARS > start=1&end=200&trim=both][removehtml][Body][/REMOVEHTML][/GETCHARS] > > > Returns: > > MacBook Air takes laurels in three-way usability competition Of three > ultrathin portables - MacBook Air, Toshiba Portege, and Lenovo > ThinkPad - which is the most usable? To find out, Computerworld tur > > I think you are just getting lucky :) > > > - Charles > > On Jul 3, 2008, at 9:16 AM, Frank Nordberg wrote: > >> Stuart Tremain wrote: >> >>> It is meant to cut off a block of text between char 220 to 260 but >>> only at a space, ie not cutting a word in half >> >> This is the code I use for a similar purpose: >> >> [GETCHARS >> start=1&end=200&trim=both][removehtml][Body][/REMOVEHTML][/GETCHARS] >> >> It seems to work fine but looking at it now, I can't understand why. >> According to the WebDNA documentation the "trim=both" parameter only >> removes spaces that may have ended up at the beginning or end of the >> string but it apparently it's much more useful than that, removing >> incomplete words from the ends of the string as well. >> > > > > Matthew Bohne

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:

For those of you not on the WebCatalog Beta... (1997) Cookies and customers with cookies turned off (2005) Loops N Variables (1998) Bill To - Ship To Information display (1997) unable to launch acgi in WebCat (1997) More news on 5.0 (2003) Re[2]: Wierd problem with 3.08 WIN Version (2000) Multiple Pulldowns (1997) WebCat2b13MacPlugIn - More limits on [include] (1997) Email (1998) WC TableGrinder (1997) Using Applescript to process WebCatalog functions (1998) [shownext] and sort (1998) Requiring that certain fields be completed (1997) Nested search (1997) Showif date > other date (2004) [WebDNA] agree? --> [url] broken inside [redirect], on a square-bracket-style include, included from a XML-style page (2009) webcat- multiple selection in input field (1997) BUG?-.html extention not working. (2000) Banners (1997)