Jump to content

Recommended Posts

 

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.

Share this post


Link to post
Share on other sites

What's the Function name, Or link?

Share this post


Link to post
Share on other sites

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 by hutchlad

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×

Important Information

By using this site, you agree to our Terms of Use.