Re: [WebDNA] Count Lines

This WebDNA talk-list message is from

2011


It keeps the original formatting.
numero = 106627
interpreted = N
texte = Here is the function I use to truncate to the nearest word and add an elipse if text gets truncated.

To use: [truncate text=(your text here)&max=(your max here)]

Function:

[function name=truncate]

[if [countChars][text][/countchars]>[max]]
[then]
[return][middle endBefore=%20][getChars start=1&end=[max]][text][/getChars][/middle]...[/return]
[/then]
[else]
[return][text][/return]
[/else]
        [/if]

[/function]
Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] Count Lines (Stuart Tremain 2011)
  2. Re: [WebDNA] Count Lines (Olin Lagon 2011)
  3. Re: [WebDNA] Count Lines (Aaron Michael Kaczmarek 2011)
  4. Re: [WebDNA] Count Lines (Steve Craig 2011)
  5. Re: [WebDNA] Count Lines (Stuart Tremain 2011)
  6. Re: [WebDNA] Count Lines (William DeVaul 2011)
  7. Re: [WebDNA] Count Lines (Tom Duke 2011)
  8. [WebDNA] Count Lines (Stuart Tremain 2011)
Here is the function I use to truncate to the nearest word and add an elipse if text gets truncated.

To use: [truncate text=(your text here)&max=(your max here)]

Function:

[function name=truncate]

[if [countchars][text][/countchars]>[max]]
[then]
[return][middle endBefore=%20][getChars start=1&end=[max]][text][/getChars][/middle]...[/return]
[/then]
[else]
[return][text][/return]
[/else]
        [/if]

[/function]
Olin Lagon

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:

Re:quit command on NT (1997) [isfile] ? (1997) Roundup function? (1997) The Guru Speaks (1998) RE: WebCat cannot handle compatible search parameters? (1997) Errata: WCS Newbie question (1997) Database Sizes (2000) problem: mail changed (1997) Location of Browser Info.txt file (1997) [convertChars] and HTML Tags (1997) [WebDNA] Mac Question (2018) WebDNA Solutions ... sorry! (1997) greater than or equal to (1997) [append] (1997) Problem 2: Prefs file... (1997) read and write you own cookies with webcat (1997) Help formatting search results w/ table (1997) Seeking Better Display of results... (1997) [WebDNA] a major shift in strategy? (2008) Separate SSL Server (1997)