December 14, 200421 yr Hi I'm working on a FileMaker based content management system. Users post their updates into the system and they appear on the web. I'm trying to make a field so that it shows the first 90 or so words of an update, so that I can do a PHP include to it on the front page. When users make an update, certain users can post HTML in theirs. In my synopsis field, I've tried the LeftWords function and the MiddleWords function and both seem to produce the desired effect. Apart from... Where a user has put html in the opening line of their update For example <img src="http://imagelocation" alt="" border="0" align="right" />rest of update follows on from here Then the opening < gets cut off from the synopsis field by both LeftWords and MiddleWords. Obviously then the image doesn't display properly. Is there a way to get this to work in a calculation but witout the clipping of the opening '<' character?? Why does the opening '<' character get cut off? If there's text in front of the opening '<' then it works. Any ideas? Batfastad
December 14, 200421 yr Author Even if I go like this in my synopsis field... MiddleWords( Middle( UPDATE TEXT, 0, 20000) , 0, 80) The leading '<' still gets cut off Any ideas? Thanks Ben
December 14, 200421 yr Author Excellent!! That'll fix it. Any idea why the LeftWords and MiddleWords functions clip off the leading '<'? Thanks QuinTech!!! Ben
December 14, 200421 yr FM just doesn't recognize < as a word, that's all. Which makes sense from an English perspective, if not an html perspective. J
December 14, 200421 yr In case your text ends with a closing carat or you just want to be safe, you could also use something like Substitute( Substitute( MiddleWords( Substitute( Substitute( UPDATE TEXT, "<", "YYYY" ), ">", "ZZZZ" ), 0, 80 ), "YYYY", "<" ), "ZZZZ", ">" )
Create an account or sign in to comment