Re: Count Characters

This WebDNA talk-list message is from

2005


It keeps the original formatting.
numero = 63431
interpreted = N
texte = If your [news_body] contains comparison characters (!, =, <, >, etc) that will foul up your [hideif [news_body]=] tag - url'ing [news_body] there ([hideif [url][news_body][/url]=]) will help. Also, if your [news_body] contains HTML code, you may be truncating it in a bad place resulting in invalid HTML - use [removehtml] to strip the HTML before processing it if that's a problem. Brian Fries BrainScan Software On Nov 17, 2005, at 11:05 AM, David Bastedo wrote: > > > --------------------------------------------------------------- > David Bastedo > Ten Plus One Communications > 416.603.2223x1 > http://www.10plus1.com > > Hi: my first post in a LONG time, though I have been learning lots > from > all of you. Thanks. > > I am building an archive of sorts and people paste in text to a > text box > and I store it. Well, that's the basics. > > Anyways, when I display the text, I often want to show the first 500 > characters and then display a click for more info button etc. > > So, the code I have written seems to work only part of the time and I > can't figure out what's amiss. > > I count the total characters in the entry, see if it is over a max, if > it is, then I show the first x (500) characters with the more button. > > The problem, is even though the code shows let's sat 1500 > characters, it > will not register the [body_text] tag as having content, and shows > it as > being empty, even though I know it has content. When I click to > view the > entry, the text comes up, but I can't seems to definitively show the > first 500 characters . . . > > [math show=F]MyTotal=[CountChars][unurl][convertchars > db=databases/customConvert.db][news_body][/convertchars][/unurl][/ > CountC > hars][/math] > > [showif [MyTotal]>[MyTextMax]] > [text]MyBody=[GetChars > start=1&end=500][unurl][convertchars > db=databases/customConvert.db][news_body][/convertchars][/unurl][/ > GetCha > rs]...
[/text] > [/showif] > > [showif [MyTotal]<[MyTextMax]] > [text]MyBody=[GetChars > start=1&end=[MyTotal]][unurl][convertchars > db=databases/customConvert.db][news_body][/convertchars][/unurl][/ > GetCha > rs]
[/text] > [/showif] > > [hideif [news_body]=]Body: [unurl > ][convertchars > db=databases/customConvert.db][news_body][/convertchars][/unurl] >

> [/hideif] > > > thanks in advance. > > D. ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Count Characters ( "David Bastedo" 2005)
  2. Re: Count Characters ( Brian Fries 2005)
  3. Count Characters ( "David Bastedo" 2005)
If your [news_body] contains comparison characters (!, =, <, >, etc) that will foul up your [hideif [news_body]=] tag - url'ing [news_body] there ([hideif [url][news_body][/url]=]) will help. Also, if your [news_body] contains HTML code, you may be truncating it in a bad place resulting in invalid HTML - use [removehtml] to strip the HTML before processing it if that's a problem. Brian Fries BrainScan Software On Nov 17, 2005, at 11:05 AM, David Bastedo wrote: > > > --------------------------------------------------------------- > David Bastedo > Ten Plus One Communications > 416.603.2223x1 > http://www.10plus1.com > > Hi: my first post in a LONG time, though I have been learning lots > from > all of you. Thanks. > > I am building an archive of sorts and people paste in text to a > text box > and I store it. Well, that's the basics. > > Anyways, when I display the text, I often want to show the first 500 > characters and then display a click for more info button etc. > > So, the code I have written seems to work only part of the time and I > can't figure out what's amiss. > > I count the total characters in the entry, see if it is over a max, if > it is, then I show the first x (500) characters with the more button. > > The problem, is even though the code shows let's sat 1500 > characters, it > will not register the [body_text] tag as having content, and shows > it as > being empty, even though I know it has content. When I click to > view the > entry, the text comes up, but I can't seems to definitively show the > first 500 characters . . . > > [math show=F]MyTotal=[countchars][unurl][convertchars > db=databases/customConvert.db][news_body][/convertchars][/unurl][/ > CountC > hars][/math] > > [showif [MyTotal]>[MyTextMax]] > [text]MyBody=[GetChars > start=1&end=500][unurl][convertchars > db=databases/customConvert.db][news_body][/convertchars][/unurl][/ > GetCha > rs]...
[/text] > [/showif] > > [showif [MyTotal]<[MyTextMax]] > [text]MyBody=[GetChars > start=1&end=[MyTotal]][unurl][convertchars > db=databases/customConvert.db][news_body][/convertchars][/unurl][/ > GetCha > rs]
[/text] > [/showif] > > [hideif [news_body]=]Body: [unurl > ][convertchars > db=databases/customConvert.db][news_body][/convertchars][/unurl] >

> [/hideif] > > > thanks in advance. > > D. ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Brian Fries

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:

Error Lob.db records error message not name (1997) .. more on sliding discounts... (1997) Email notification to one of multiple vendors ? (1997) [WebDNA] showif with empty variable (2015) Quit revisited (1997) LetterRip and WebCat (1998) [WebDNA] Is there a good file upload script available these days? (2009) [WriteFile] problems (1997) This list needs a digest: rant, rave... (1997) Updating a database once per day - An example (1998) Major Security Hole (1998) My slower response (1997) Help name our technology! (1997) YACBQ.....(Yet another checkbox question) (2000) Processing all html files through WebCat or Typhoon (1998) Inventory lookup & display... (2003) listfiles-looking for slick solution (1997) How is it done? (1998) Ship Cost Calculated via Subtotal (1998) denied access (1997)