>> And the place where the text is truncated should *not* fall on a period between words.
if you are sure the break in text should NOT be on a period, this code will do that:
<cfset defaultbreakpos = 1000>
<cfif mid(string1, defaultbreakpos, 1) is ".">
<cfset temppos = refindnocase("[^\.]", reverse(left(string1, defaultbreakpos)))>
<cfset breakpos = defaultbreakpos-temppos+1>
<cfelse>
<cfset breakpos = defaultbreakpos>
</cfif>
<cfset toptext = left(string1, breakpos)>
<cfset bottomtext = mid(string1, breakpos+1, len(string1))>
<table align="center" width="924">
<tr>
<td width="25%">IMAGE HERE</td>
<td width="75%">#toptext#</td>
</tr>
<tr>
<td colspan="2">#bottomtext#</td
</table>
HOWEVER... if your string1 contains any html tags, there is a high chance your text will be truncated in a position inside a tag, 'breaking' the tag and resulting in the tag's code being interpreted as text and displayed in your page as such...
also, if all you want to do is make your text wrap around your image, you do not need any of the above. all you need is a little styling of the <img> tag:
<table align="center" width="924">
<tr>
<td>
<img src="..." style="float:left; margin:0 20px 20px 0;" />
#string1#
</td>
</tr>
</table>
Azadi
Main Topics
Browse All Topics





by: ryancysPosted on 2009-09-24 at 23:53:33ID: 25420509
try use mid function, like:
<td colspan="2">#mid(string1, 1001, len(string1)-1000)#</td></tr>