April 20, 20178 yr Hi, Here is a custom function that I found on Briandunning.com. The problem is when I try to create a new function with this code, Filemaker refuses it saying Quote An operator (e.g. +, -, *, …) is expected here. The "here" above is situated before the parentheses after "WordWrap" and before "UnprocessedText". Would someone be kind enough to tell what I'm missing here to get this up and running? Let ([ TruncatedText = Left ( Text ; Size + 1 ) ; CountOfSpaces = PatternCount ( TruncatedText ; " " ) ; CountOfReturns = PatternCount ( TruncatedText ; "¶" ) ; PositionOfLastSpace = If ( CountOfReturns > 0 ; Position ( TruncatedText ; "¶" ; 1 ; 1 ) ; Position ( TruncatedText ; " " ; 1 ; CountOfSpaces ) ); AddReturn = If ( CountOfReturns > 0 ; "" ; " ¶" ); ThisLine = Trim ( Left ( TruncatedText ; PositionOfLastSpace ) ) ; UnprocessedText = Right ( Text ; Length ( Text ) - PositionOfLastSpace ) ; Result = If ( Length ( Text ) ≤ Size ; Text; ThisLine & AddReturn & WordWrap ( UnprocessedText ; Size ) ) ]; Result ) Sorry everyone. Please dismiss my post. I just realised that I was trying to include "WordWrap" as a function parameter and as the function name. All's well.
July 31, 20178 yr Dysong, Most custom functions built by other people require a Function Parameter. Such as 'StartDate' or whatever bit of information is needed in the function. It is a common mistake for people to overlook this, EDIT - I didn't notice the post had been edited and OP had found a solution. /closed Edited July 31, 20178 yr by hutchlad
Create an account or sign in to comment