Software Venture Consulting

FileMaker Pro downloads & Resources
FileMaker Custom Functions
FileMaker Web Viewer Examples
FileMaker Pro & Lasso Consulting
Training
FileMaker Books
FileMaker Articles
FileMaker Error Reference

Free Web Tools
Free FileMaker Tools

Personal Pages
Videos
Adventures
Links

Shopping Cart
Shopping Cart

Search:

Free Newsletter
Signup


Contact


Privacy Policy



FileMaker is a registered trademark of FileMaker, Inc. in the U.S. and other countries.

 

 FileMaker Pro Custom Functions

List  |  Show Random  |  Upload  |  Add This to Your Site

NumberList ( start ; end ; increment )

Rate this function:  

RatingRatingRatingRatingRating
  Average rating: 4.4  (37 votes)
  Discuss this Custom Function

Gordon Kilgour, n/a
n/a

Returns a list of numbers from 'start' to 'end', incremented by 'increment'

Sample Input:
NumberList ( 2 ; 5 ; 0.5 )
Sample Output:
2
2.5
3
3.5
4
4.5
5


 Then copy & paste into FileMaker Advanced's Edit Custom Function window.

Click here to copy To Clip Manager if you have myFMbutler's Clip Manager installed

Description:

Returns a carriage-return separated list of the numbers from 'start' to 'end' inclusive, incremented by the 'increment' value. Good for a Pop-up Menu or Drop-down List to limit user entry to specific values.

For example, for all even numbers from 2 to 8,
NumberList ( 2 ; 8 ; 2 ) would return:-
2
4
6
8

For all tens from 50 to 100,
NumberList ( 50 ; 100 ; 10 ) would return:-
50
60
70
80
90
100

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

This is my Custom Function and I want to edit it

Discuss:

5 most recent comments | Show all 7 comments

Thank *you* -- I used it to generate the X-axis in a FileMaker charting script.

Marc Wood, Minneapolis MN
September 22, 2010 7:27pm

It hits the 10,000 recursion limit:

NumberList( 0 ; 10000 ; 1 ) = ?

Vaughan, Sydney, Australia
July 28, 2011 4:58pm

That is true Vaughan but for practical purposes it's irrelevant. It would also be very simple to add a check for this.

Gordon Kilgour, Edinburgh
May 15, 2012 3:51am

Useful!
I added some things that let you increment/decrement by picking a positive/negative 'changeBy' parameter. Note that if changeBy is negative, then your rangeStart must be greater than rangeEnd.

// ValueNumbersFromRange ( rangeStart; rangeEnd; changeBy )
// version 1.0, Daniel A. Shockley, inspired by Gordon Kilgour's NumberList, http://www.briandunning.com/cf/1172

// Generate a return-delimited list of numbers for the specified range by the specified increment.

/* VERSION HISTORY:
1.0 - intitial version.
*/


Case (

changeBy = 0 /* ERROR */
; "?"
;
changeBy > 0 and rangeStart > rangeEnd /* ERROR */
; "?"
;
changeBy < 0 and rangeStart < rangeEnd /* ERROR */
; "?"
;
rangeStart = rangeEnd
; rangeStart
;
List ( rangeStart; ValueNumbersFromRange ( rangeStart + changeBy; rangeEnd; changeBy ) )
)

Dan Shockley, New York, NY
August 26, 2014 2:23pm

Actually, don't return "?" if the rangeEnd/rangeStart seem wrong, since you might be going from 2 to 7 incrementing by 2 and don't want to get 2¶4¶6¶?
Instead, just return "" when that happens so you would get, in this example, 2¶4¶6

Updated calc:
// ValueNumbersFromRange ( rangeStart; rangeEnd; changeBy )
// version 1.0, Daniel A. Shockley, inspired by Gordon Kilgour's NumberList, http://www.briandunning.com/cf/1172

// Generate a return-delimited list of numbers for the specified range by the specified increment.

/* VERSION HISTORY:
1.0 - intitial version.
*/


Case (

changeBy = 0 /* ERROR */
; "?"
;
changeBy > 0 and rangeStart > rangeEnd /* Finished */
; ""
;
changeBy < 0 and rangeStart < rangeEnd /* Finished */
; ""
;
rangeStart = rangeEnd
; rangeStart
;
List ( rangeStart; ValueNumbersFromRange ( rangeStart + changeBy; rangeEnd; changeBy ) )
)

Dan Shockley, New York, NY
August 27, 2014 8:14am

Make a comment about this Custom Function (please try to keep it brief & to the point). Anyone can post:

Your Name:
City/Location:
Comment:
characters left. If you paste in more than 1500 characters, it will be truncated. Discuss the function - advertisements and other useless posts will be deleted.
Answer 9 + 9 =
Search for Custom Functions:

Custom Functions Widget
Download the Custom Function Dashboard Widget for OS X
Keep all the latest Custom Functions right at your fingertips!

Newest Custom Functions:

1. ProperAllWords ( text )
  (Thu, Dec 14, 5:19pm)
2. MatchExist ( SourceTable.Field ; DestTable.Field ; ReturnField )
  (Thu, Dec 14, 1:07pm)
3. BVR_Format ( bvr )
  (Wed, Dec 13, 5:32pm)
4. NumberToHexadecimal(NumberValue)
  (Fri, Dec 08, 8:54am)
5. Get_BaseTable
  (Thu, Dec 07, 4:27pm)
6. JSONCreateVarsFromKeys ( json ; namespace )
  (Wed, Dec 06, 8:21pm)
7. GetTableNzme ( field )
  (Tue, Dec 05, 9:16pm)
8. TimeFormatAsText ( theTime )
  (Mon, Nov 13, 1:59pm)

RSS Feed of Custom Functions