Mitsules, Mark
Mark.Mitsules at ngc.com
Thu Jan 13 14:42:09 CST 2005
Group, I have a large recordset of strings that need to be split up by length, maximum of 53 characters per line, not to exceed 2 lines. The issue I am struggling with is maintaining logical word breaks. For instance, here is an example string (watch for line wrap): VENTILATION CONNECTION UNDER 1ST, 2ND & 3RD PLATFORM, FR 37-39 - HANGER DETAILS MANUFACTURING Can anyone suggest a good routine to accomplish this? Here are my first thoughts... I would like to take any line over 40 characters and split it into 2 lines, so the pseudocode might be something like: If len(strTitle) > 40, Then starting point is at the halfway point If at a space, then make the break here Else count number of characters forward to a space count number of characters backward to a space make the break at the lower of the two End If End If Thanks for any suggestions. Mark