Brian Dunning's FileMaker Custom Functions

NewWindowName ( name )

Generates a unique window name by appending -N to the window name.

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

Vaughan Bromfield   Vaughan Bromfield - Show more from this author

Share on Facebook Share on Twitter

  Sample input:
NewWindowName ( "Untitled" )
  Sample output:
Untitled-2 if a window named Untitled is already open.

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

NewWindowName ( name )

by Vaughan Bromfield
Version 1.0
8 March 2012

Returns a unique window name based on the text passed to the function.

It attempts to use the same rules the FMP natively uses when duplicating windows:

If the window name already exists then " - n" is appended, where n≥2.

If the window name already has " - n" at the end then:
return the base window if it does not exist
else increment the number n.

 

Comments

unix   unix, Japan
Feb 1, 2016
You can use
SerialIncrement ( name ; 1 )
for incrementing right most number part in text.
 

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: