dysong3

help — function not working

2 posts in this topic

 

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

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

  • Similar Content

    • By rick altman
      I have a field that receives a bunch of first names from a portal, thanks to the List function. The result might look like this:
       
      Alice, Bill, Chuck
       
      However, I need for the list to read:
       
      Alice, Bill, and Chuck
       
       
      I need to find the last comma in the text and add an "and" to it. I have been messing around with the Position function stuffed inside of a Substitute function, but I can't get it right. Can someone help?
       
      FMPA14
       
       
      Rick A.
      Pleasanton CA
    • By Jeff M
      I have a few situations where I need to be something specific having to do with dates.
      For the sake of this example, let's say we're dealing with pay periods.
       
      payperiods table will have 1 record for each pay period. It will have a pay period number, a date the pay period starts and a date the pay period ends. See attachment table.png
       

       
      From other tables, when a user enters a date...I need to be able to return the pp_number for which that date belongs.
      For instance, entering 7/12/2014 would return 2.  Entering 7/19/2014 would return 3.
       
      Nothing is set in stone here, I'm open to a different structure, I just need an efficient way of looking up the pay period number.
       
      Suggestions?
       
      Thanks in advance!!!
      Jeff
    • By gabbaymeir89
      Hi
       
      im still a bit of a beginner with filemaker
       
      i have been trying to figure this out but need a little help. 
       
      I have this function
       
      If (GetAsDate ( Date1) - GetAsDate (  Date2 )  <  0 ;  Date1 + 28 ;  Date1 )  
       
      What i need is to turn it in to a loop
       
      so that 28 is added to Date1 until Date1 is higher than Date2
       
      I have tries and testes let function and loop,
       
      if any one could help 
       
      Many Thanks
       
      Meir
       
       
    • By tomasd
      I have registered external function:   trimWhitespace (text)     if (text == null) return text;   return text = text.trim();     If I put this function in indexed calculation field, question mark is displayed instead of text. Is it a bug?
    • By Wardiam
      Hi Everybody,
       
      I have a text field with a text that contains normal and red-bold characters, I would like to count the number of characters with bold style. Could anyone help me to do this operation with a function?
       
      I am trying to do an script that extracts the portion of normal text to calculate the length and then calculate the number of total characters minus normal text.
       
      What is the best option? a function or an script?
       
      Thank you very much,
      Wardiam