Jump to content
Sign in to follow this  
  • entries
    44
  • comments
    0
  • views
    359

FileMaker While Function

Sign in to follow this  
dbservices

99 views

FileMaker While Function

Sometimes smallest features offer the biggest impact. The new While function, which gives the ability to loop within a calculation, drastically reduces the need for one-off recursive custom functions, speeding up development in any part of FileMaker that requires looping in a calculation. Let’s take at how it works.

How It Works

The format of a while function is broken into four parts: initial variables, the condition, logic, and the results. The function repeats the logic section until the condition is false; that is how the function provides the ability to loop. In the example below the While function returns a list of numbers 1 through 5:

While ( 
    [ 
     count = 1; 
     numberList = "" 
    ]; 
    count < 6 ; 
    [
     numberList = numberList & (count) & "¶"; 
     count = count + 1 
    ]; 
numberList 
)

The function returns:

1
2
3
4
5

Notes

  • Initial variables are available throughout the loop of the function.
  • You can define multiple initial variables by enclosing them in brackets, similar to how let functions work.
  • Variables that need to retain information from each iteration must be defined in the initial variable section otherwise their values are empty in the next iteration.
  • To prevent infinite loops the while function will return “?” after the number of iterations exceeds a limit.
  • The default limit is 50,000 iterations. Use the new function, Set Recursion, to set a new limit to the number of iterations.

Conclusion

With the advent of the While function, development of FileMaker applications will become a simpler and quicker process, eliminating the need for one-off recursive functions. Download the demo file to try out the new function.

Did you know we are an authorized reseller for FileMaker Licensing?
Contact us to discuss upgrading your FileMaker software.

Download FileMaker Square IntegrationDownload FileMaker While Function Database

Please complete the form below to download your FREE FileMaker database file.

  • Name*
    First Last
  • Company
  • Phone*
  • Email*
  • FileMaker Experience*
    • New to FileMaker Platform
    • Existing User of FileMaker
    • Existing Developer of FileMaker
  • Terms of Use
    • I agree
    OPT-IN: I agree that I am downloading a completely free FileMaker application file with no strings attached. This database is unlocked, and I may use it for my business or organization as I see fit. Because I am downloading a free database, I agree that I should receive occasional marketing. I understand that I can OPT-OUT of these emails at anytime.

View the full article

Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Guest
Add a comment...

×   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.

×
×
  • Create New...

Important Information

Terms of Use