just keep in mind that periods exist in text for other reasons than ending sentences - this code will NOT always work as intended
This will kill your desired end result "There are 4.5 houses finished." ;-) Sorry....I don't have a solution handy - just spotted a potential issue Take care -Bryan *Bryan Stevenson*B.Comm. President & CEO Electric Edge Systems Group Inc. - makers of FACTS™ phone: 250.480.0642 cell: 250.920.8830 e-mail: br...@fisheryfacts.com <mailto:br...@fisheryfacts.com> web: www.fisheryfacts.com <http://www.fisheryfacts.com> ------------------------------------------------------------------------ Please consider the environment before printing this e-mail -----CONFIDENTIALITY------ This message, including any attachments, is confidential and may contain information that is privileged or exempt from disclosure. It is intended only for the person to whom it is addressed unless expressly authorized otherwise by the sender. If you are not an authorized recipient, please notify the sender immediately and permanently destroy all copies of this message and attachments. On 2015-03-07 8:22 AM, Captain Obvious wrote: > Variable I is undefined. > > This works, > > <cfif len(variables.description) gt 200> > <cfset variables.i = false> > <cfloop condition="variables.i eq false"> > <cfset variables.description = > listDeleteAt(variables.description,listLen(variables.description, > "."),".")> > <cfif len(variables.description) lte 200> > <cfset variables.i = true> > </cfif> > </cfloop> > </cfif> > <cfoutput>#variables.description#</cfoutput> > > On Sat, Mar 7, 2015 at 1:31 AM, Mark Spence <markpence...@gmail.com> wrote: >> I have a long product description I am trying to truncate. I could just >> truncate it, but I don't want to break off sentences. Here is the solution >> I came up with but it does not seem to have any effect. >> >> Any ideas? >> >> <cfset variables.description = qry_productsGet.productdescription> >> <cfif len(variables.description) gt 200> >> <cfloop condition="i eq false"> >> <cfset variables.description = >> listDeleteAt(variables.description,listLen(variables.description, "."), >> ".")> >> <cfif len(variables.description) lte 200> >> <cfset i = true> >> </cfif> >> </cfloop> >> </cfif> >> >> >> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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:360230 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm