FileMaker 18 – While Function
In this post, we will talk about how to use While Function in FileMaker 18. It is an extremely useful function available in FM 18.
FileMaker 18 Introduces the While Function. Using this function we can create looping calculations. In Previous, Custom functions have performed the looping calculation via recursion. Now the While function simplifies the looping calculations.
The following parameters are used in the While function,
- Initial Variable
Previously, we used the custom functions to calculate the Weekdays between the two specific dates. Now we are going to see how to calculate the Weekdays between the two specific dates using While function.
The following While function will returns the Weekdays between the 06-07-2020 and 26-07-2020,
Now we are going to see the each section of the function
The Initial Variable parameter will define the variables which are all needed later in the function. In this Example, We have define the following parameters
The Condition parameter is a Boolean Expression evaluated before each loop iteration. While True, the loop repeats. When False, the loop stops.
In Our Example the loop will continue as long as the “Number of days” less than the Total number of days between the Start date and End Date.
In Our Example, the “Days” will get the dates between the Start date and End date.
“Name” will get the Day names between the Start date and End date.
“Number of days” is incremented by 1.
“Weekdays” will calculate the list of Weekdays using the “Days”, ”Name” and “Number of days”
Result Parameter is an expression which gives the result when the loop stops.
In Our example, we placed the Weekdays list on the “Weekdays” variable. It will give the following result,
Contact Us for FileMaker 18 Services
That’s it for this article and now you know how to use While Function in FileMaker 18. For more on other FM 18 attributes, there’s our post, Key Features of FileMaker 18 Explained.
FMDBSolutions is a team of custom FileMaker app experts with massive knowledge and wide understanding of FileMaker. We have many projects under our belt, which you can see by viewing our FileMaker Portfolio.
We work with clients on a global scale and have done so for the better part of a decade. Want solutions? Choose us. We can handle all types of projects, big and small. Contact our team right now or press this box for a free FileMaker consultation
You can also leave us your email below for receiving new updates regarding FileMaker and our company.