I am trying to use the cf wrap function and I am getting some odd results.
Here is the text (entered in a text area...the line breaks shown are from
hitting the enter key)

Life is but a stopping place,
A pause in what's to be.
A resting place along the road,
To sweet eternity.

Here is the results of the text string after it is wrapped and put into an
array.  Why would A be in a single line instead of part of the contents of
line three and also notice the odd breaks with 4,5,6, and 7

array
1     Life is but a stopping place,
2     A
3     pause in what's to be.
4     A resting
5     place along the road,
6     To sweet
7     eternity.

Should look like
1. Life is but a stopping place,
2. A pause in what's to be.
3. A resting place along the road,
4  To sweet eternity.

here is the code that accomplishes the above.  Arguments.char_count=34 int
his case.

<cfset variables.text.txtWrapped=wrap(variables.text.string,
arguments.char_count)>
        <cfset nol=listlen(variables.text.txtWrapped,"#chr(10)#")>
        <cfset variables.text.txtLines=arrayNew(1)>
        <cfloop from="1" to="#nol#" step="1" index="x">
            <cfset variables.text.txtLines[x]="
"&listgetat(variables.text.txtWrapped,x,"#chr(10)#")>
        </cfloop>

Any ideas as to what i am doing wrong?


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339001
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to