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

NumberRange_Explode ( numberRangeText )

Rate this function:  

RatingRatingRatingRatingRating
  Average rating: 4.6  (30 votes)
  Discuss this Custom Function

Jonathan Mickelson, Thought Development Corp.
http://thought-dev.com

Receives a string of numbers separated by commas, hyphens, or any multiple or combination or both, and returns a return delimited list of all whole numbers within the input ranges

Sample Input:
NumberRange_Explode ( "1-3,5,7-10" )
Sample Output:
"1¶2¶3¶5¶7¶8¶9¶10"


 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:

This takes a number string either as commas (1,5,8) or a hyphen (2-11), or any combination of the two (2,7,10-14,21,50-62,72), and returns a return delimited list of all whole numbers included within the given ranges.

This is very useful in building multi-line keys for relationships, or in conjunction with other methods, such as substitute lists or the awesome CustomList ( ) function.

NOTE: hyphenated ranges can be given in any order (2-5 or 5-2), results are ordered from smallest number to largest, regardless or original order.

Examples:

- NumberRange_Explode ( "1-3" ) = "1¶2¶3"
- NumberRange_Explode ( "2,4,8,11" ) = "2¶4¶8¶11"
- NumberRange_Explode ( "1-3,5,7-10" ) = "1¶2¶3¶5¶7¶8¶9¶10"
- NumberRange_Explode ( "20-16" ) = "16¶17¶18¶19¶20"

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:

Hi,

I'm very excited to see this, I've been struggling to find this function for awaile. Unfortunately I'm a bit of a newbie so I'm not able to get it to work. Would it be possible to post a demo?

Cheers
Adam

Adam, Melbojrne
February 06, 2013 8:51pm

Hi Adam,

I've tried re-pasting the text form a working version, just in case something was wrong in the previous pasted version. This works and is in production for me.

This is a recursive function, so it must be made into a Custom Function to work, since it must call itself until it is finished.

I'm not sure what part is tripping it up for you, but here's a brief step by step:

- Open FileMaker Pro Advanced, to add a new Custom Function.
- Copy and paste the text within the calc window above into it.
- Edit the Function name and parameters to match the Comment at the top of the calc text.

When you close the dialog it should validate the calc, and close correctly. You may now use the function. I'd suggest opening the Data Viewer, and pasting the following into the calc to test it:

NumberRange_Explode ( "1-3,5,7-10" ) = "1¶2¶3¶5¶7¶8¶9¶10"

You should see the result in the results area below and it will look like this:

1
2
3
5
7
8
9
10

Hope that helps!! Enjoy!
Jonathan

Jonathan Mickelson, Los Angeles, CA
February 07, 2013 9:54am

Hi,

I'm looking for something that does the opposite of this -- where the input would be a list of numbers and the output would be a number range as text.

So something like:
NumberRange_Create ( "1¶2¶3¶5¶7¶8¶9¶10" ) = "1-3, 5, 7-10"

I've attempted to wrap my mind around building this with a custom function but it's beyond my training. Any ideas?

Many thanks

LG, LA
August 24, 2016 4:19pm

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 6 + 1 =
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. NumberToHexadecimal(NumberValue)
  (Fri, Dec 08, 8:54am)
2. Get_BaseTable
  (Thu, Dec 07, 4:27pm)
3. JSONCreateVarsFromKeys ( json ; namespace )
  (Wed, Dec 06, 8:21pm)
4. GetTableNzme ( field )
  (Tue, Dec 05, 9:16pm)
5. TimeFormatAsText ( theTime )
  (Mon, Nov 13, 1:59pm)
6. ParseWebValueList( text )
  (Thu, Nov 02, 9:52am)
7. SVG_HTML_to_Text ( _svg_text ; _orig_text ;
  (Wed, Oct 25, 4:17am)
8. decFromHex ( hexValue )
  (Mon, Oct 16, 12:34pm)

RSS Feed of Custom Functions