Brian Dunning's FileMaker Custom Functions

NextBinPattern

The next binary pattern

  Average rating: 4.2 (25 votes) Log in to vote

Erich Schmidt   Erich Schmidt - Show more from this author

Share on Facebook Share on Twitter

  Sample input:
NextBinPattern(44)
NextBinPattern(48)
NextBinPattern(63)
  Sample output:
49
65
95

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

The function returns the next higher number whose binary form contains as many 1 as the binary form of the parameter "decimal"

 

Comments

Crispin   Crispin, UK
Sep 2, 2015
I'd love to know why anyone would want this?
 
Erich   Erich, Rostock/Germany
Sep 2, 2015
This allows the solution of any choice problem in an easy way. For a mask-controlled choice you need every binary pattern with the same number of binary digits 1.

See also: description of GetPatternList()
 

Log in to post comments.

 

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

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: