Jump to content
Sign in to follow this  
dysong3

help — function not working

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Similar Content

    • By naio
      My solution is build according to the 'separation model', so I would like to keep control of the local file containing the layout and presentation of the data hosted in the server.
      I wonder if I could have a script to control wether the local file gets its structure, layout or scripting modified, so I need a function to control when a change to the file has been made before giving it a version number. When the file gets open only to work with the hosted data it's not a new version.
       
    • By NewBoard
      I have stumbled upon a strange bug in one of my Databases concerning a value list.
      We have a table containing part numbers, which is related to a table containing "revisions" for the part numbers, which is related to a table of inspections for the "revisions".
      On a layout of the Inspections table, I have a value list. This value list selects the UUID of the revision, but displays the Part Number for the user.
      This has worked perfectly for several months. However, this morning one of my users discovered that he was unable to located "0000194" from this list. At first I thought maybe the UUID's somewhere along the line had become disconnected from their respective foreign keys on related tables. This was not the case. I then tried deleting and remaking the value list. This did not solve my problem. Then I figured if I deleted and rebuilt everything related to 0000194 that would fix it. This was not the case either. As a last ditch effort I restarted our FileMaker server, to no such luck.
      So then I began playing around with various aspects of 0000194. First I changed the company name, but it still didn't show up on the value list. Then I changed the part number to "TESTPART", and it showed up perfectly. So I tried "0194" and that showed up. Same for "00194" and "000194", but as soon as I add a fourth zero making it 0000194, it disappears from my value list. I'm 95% sure that this part number used to show up on the value list just fine, as we've already done inspections using this part number. So I'm thinking this bug has something to do with the leading zeros. I'm unsure of how to debug this or if there's any workarounds for this issue.
      Let me know if I need to supply any more information.
      Thank you in advance for any help you all can offer!

      [SOLUTION] At some point one of our scripts was run by a user without full permissions. The script added part number "0000194" to another customer, which I never noticed. Since Value Lists are indexed, it was not showing "0000194" because it was not a unique value. Deleting the second occurrence of "0000194" cleared my problem up.
    • 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
       
       
×
×
  • Create New...

Important Information

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