Brian Dunning's FileMaker Custom Functions

MatchPrefix ( theList ; thePrefix )

Returns first value in a list that matches the supplied prefix.

  Average rating: 4.5 (29 votes) Log in to vote

Jeremiah Small   Jeremiah Small - Show more from this author
Soliant Consulting, Inc.
https://www.soliantconsulting.com

Share on Facebook Share on Twitter

  Sample input:
MatchPrefix ("
ItemA1¶
ItemB1¶
ItemB2
" ; "ItemB" )
  Sample output:
ItemB1

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

Updated so List parameter doesn't conflict with new native List function.

Returns the first value from a list that matches the supplied prefix.

This CF was designed to aid in window management. When the list supplied is the function WindowNames, the CF returns the first open window name that matches the supplied prefix. Used in conjunction with a looping routine that is run prior to opening a new window with the name "Example", you can ensure that any existing windows that begin with "Example" are closed before invoking the new "Example" window. This is useful in defeating proliferation of windows created with the New Window command that share the same base name as their master window, but have numbered suffixes.

 

Comments

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 15 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: