Re: Some pointers please
This WebDNA talk-list message is from 2008
It keeps the original formatting.
numero = 69745
interpreted = N
texte = Hi CraigI think that I am correct in saying that you don't want to break a word only break at a space.I use this to create a panel that only has 48 characters long and will break at a space. I have pulled it out of a template, hopefully it will work for you, may need some tweeking as I used it in building dynamic PDFs.Should get you started :)= = = = = ========================================================================[!]Initialize our variables CELL06 [/!][math show=f]count=0[/math][math show=f]numChar=[countchars][CELL06][/countchars][/math][text]curText=[/text][!]Loop through the message text one character at a time[/!][loop start=1&end=[numchar]][text]newLine=F[/text][text]curChar=[getchars start=[index]&end=[index]][CELL06][/getchars][/ text][math show=f]count=[count]+1[/math][!]This is a carriage return[/!][showif [url][curChar][/url]=%0D][text]curChar=[/text][/showif][!]This is a linefeed[/!][showif [url][curChar][/url]=%0A][text]curChar=[/text][text]newLine=T[/text][/showif][!]Add this character to our current text block - 48 characters long[/!][text]curText=[curText][curChar][/text][!]See if we need to wrap to a new line[/!][showif [count]>48][showif [url][curChar][/url]=%20][text]newLine=T[/text][/showif][/showif][!]Start a new line[/!][showif [newLine]=T][curText]
[math show=f]count=0[/math][text]curText=[/text][/showif][/loop][!]Show whatever text is left[/!][curText]
= = = = = ========================================================================RegardsStuart TremainIDFK Web DevelopmentsAUSTRALIAwebdna@idfk.com.auOn 03/02/2008, at 4:30 AM, Steve Craig wrote:> Hi>> I have a little problem with something and my brain isn't working so > any pointers or hints would be good.>> Basically I need to split a large text variable into 2 new > variables, the first 50 or so words into [var1] and then the rest > into [var2]>> It can't be just a set number of chars it must be to the nearest > complete word, and the second var must carry on from that point etc.>> Hope this is clear, any help would be much appreciated.>> 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> ========================================>>>>> -------------------------------------------------------------> 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/-------------------------------------------------------------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:
Hi CraigI think that I am correct in saying that you don't want to break a word only break at a space.I use this to create a panel that only has 48 characters long and will break at a space. I have pulled it out of a template, hopefully it will work for you, may need some tweeking as I used it in building dynamic PDFs.Should get you started :)= = = = = ========================================================================[!]Initialize our variables CELL06 [/!][math show=f]count=0[/math][math show=f]numChar=[countchars][CELL06][/countchars][/math][text]curText=[/text][!]Loop through the message text one character at a time[/!][loop start=1&end=[numchar]][text]newLine=F[/text][text]curChar=[getchars start=[index]&end=[index]][CELL06][/getchars][/ text][math show=f]count=[count]+1[/math][!]This is a carriage return[/!][showif [url][curChar][/url]=%0D][text]curChar=[/text][/showif][!]This is a linefeed[/!][showif [url][curChar][/url]=%0A][text]curChar=[/text][text]newLine=T[/text][/showif][!]Add this character to our current text block - 48 characters long[/!][text]curText=[curText][curChar][/text][!]See if we need to wrap to a new line[/!][showif [count]>48][showif [url][curChar][/url]=%20][text]newLine=T[/text][/showif][/showif][!]Start a new line[/!][showif [newLine]=T][curText]
[math show=f]count=0[/math][text]curText=[/text][/showif][/loop][!]Show whatever text is left[/!][curText]
= = = = = ========================================================================RegardsStuart TremainIDFK Web DevelopmentsAUSTRALIAwebdna@idfk.com.auOn 03/02/2008, at 4:30 AM, Steve Craig wrote:> Hi>> I have a little problem with something and my brain isn't working so > any pointers or hints would be good.>> Basically I need to split a large text variable into 2 new > variables, the first 50 or so words into [var1] and then the rest > into [var2]>> It can't be just a set number of chars it must be to the nearest > complete word, and the second var must carry on from that point etc.>> Hope this is clear, any help would be much appreciated.>> 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> ========================================>>>>> -------------------------------------------------------------> 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/-------------------------------------------------------------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/
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:
WebCat2final1 crashes (1997)
Searching for all records (1998)
Shopping Cart - prices? (1997)
Canada oh Canada (2004)
Extended [ConvertChars] (1997)
Location of Webcat site in folder hierarchy (1997)
test (2004)
Fwd: Emailer & IMail List Server (1998)
[WebDNA] WebDNA Roll Call (2013)
Problems getting parameters passed into email. (1997)
Ok here is a question? (1997)
Help w/ Duplicating The General Store 5 times. (1997)
SSL and Webstar 3 with Webcatalog (1998)
Colors in cart (2002)
FIXED - RE: Rounding Prices? (2000)
Contexts and Ampersands (1997)
Generate static pages but link problem (2004)
[WebDNA] sagepayments TLS? requests now failing (2018)
[showif] and equality (1998)
Re:Cookies and WebCat?? (1999)