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:
[ot] iBook vs. 12" PB (2004)
[OT] DOD again (2003)
Nested tags count question (1997)
Webcatalog error, Plug-in for Webstar (1996)
5.0 Pricing (2003)
Running WebCat from a CD-ROM (1997)
Lookup Notfound (1998)
Faxing orders in place of email (1997)
customizing the color of user's pages (1997)
RE: Emailer prefs in two places ... (1997)
Rhapsody? (1997)
Grepping text variable tags (was: No subject given) (2000)
PCS Frames (1997)
WebCat2b15MacPlugIn - [authenticate] not [protect] (1997)
searchable list archive (1997)
The evolved Server Configuration Queston (2000)
Need help (1998)
PIXO support (1997)
Ok here is a question? (1997)
[lineitems] and [writefile] (1998)