GetRootCopyName ( name )
Returns the root of a name which has had "copy" or "copy X" added to it
Be the first to rate this function Log in to vote
Stephan Casas - Show more from this author
http://www.stephancasas.com |
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
This function is useful when examining duplicated records. It will return the root of a supplied name that has had the term "copy" or "copy X" (where 'X' is a sequential copy number).
To use the function, supply the name for which you wish to extract the root. For example, you may have the following example names:
"my_file" or "my_file copy" or "my_file copy 14"
Passing any of these text values to the function will return "my_file" because it is the root name in each case.
The function can even handle names which use the term "copy" as part of the name itself, such as "my copy file copy 3." In such a case, the function will return "my copy file" and not "my" on its own. This is possible because the function examines the tail of the supplied name, rather than the whole name.
You can use this function with GetNewCopyName ( name ; currentList ) (available on briandunning.com) to create an effective nomenclature when duplicating records.
Comments
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.