Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 2672 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

 

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.

  • 3 months later...
Posted (edited)

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

This topic is 2672 days old. Please don't post here. Open a new topic instead.

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
×
×
  • Create New...

Important Information

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